diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-07-12 18:15:03 +0200 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-08-29 15:02:54 +0200 |
commit | 34bdb74740d0b983bfc299362b25945c9e50681c (patch) | |
tree | 290ee4a1d7d5938849acf916149ab909a51f1cfc /spec/features | |
parent | 89b30999c294d2e344d095e635d72aa16d108a2b (diff) | |
download | gitlab-ce-34bdb74740d0b983bfc299362b25945c9e50681c.tar.gz |
add sort dropdown to admin runners page
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index c4231c1ea42..de530eea10a 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe "Admin Runners", :js do include StubENV include FilteredSearchHelpers + include SortingHelper before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') @@ -91,6 +92,35 @@ describe "Admin Runners", :js do expect(page).not_to have_content 'runner-b-1' expect(page).not_to have_content 'runner-a-2' end + + it 'sorts by last contact date' do + FactoryBot.create :ci_runner, description: 'runner-1', created_at: '2018-07-12 15:37', contacted_at: '2018-07-12 15:37' + FactoryBot.create :ci_runner, description: 'runner-2', created_at: '2018-07-12 16:37', contacted_at: '2018-07-12 16:37' + + visit admin_runners_path + + within '.runners-content tbody' do + within('tr:nth-child(1)') do + expect(page).to have_content 'runner-2' + end + + within('tr:nth-child(2)') do + expect(page).to have_content 'runner-1' + end + end + + sorting_by 'Last Contact' + + within '.runners-content tbody' do + within('tr:nth-child(1)') do + expect(page).to have_content 'runner-1' + end + + within('tr:nth-child(2)') do + expect(page).to have_content 'runner-2' + end + end + end end context "when there are no runners" do |