diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-26 16:27:27 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-26 16:27:27 +0000 |
commit | 4586d77c85647063675108b0dcdcfebed0c890ca (patch) | |
tree | 382e3d9b36243bd0da2a1c59303b2851adebe68a /spec/features/admin | |
parent | 779169d337394be7cf2b76d01b42550d7a60b488 (diff) | |
parent | 2466a51407205cc16f19c2d055ca21032675e1da (diff) | |
download | gitlab-ce-4586d77c85647063675108b0dcdcfebed0c890ca.tar.gz |
Merge branch 'feature/runner-type-filter-for-admin-view' into 'master'
Feature: Runner type filter for admin view
See merge request gitlab-org/gitlab-ce!19649
Diffstat (limited to 'spec/features/admin')
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 74 |
1 files changed, 61 insertions, 13 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index a6ab6a5696a..ed9c0ea9ac0 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -73,24 +73,72 @@ describe "Admin Runners" do expect(page).to have_text 'No runners found' end + + it 'shows correct runner when status is selected and search term is entered' do + create(:ci_runner, description: 'runner-a-1', active: true) + create(:ci_runner, description: 'runner-a-2', active: false) + create(:ci_runner, description: 'runner-b-1', active: true) + + visit admin_runners_path + + input_filtered_search_keys('status:active') + expect(page).to have_content 'runner-a-1' + expect(page).to have_content 'runner-b-1' + expect(page).not_to have_content 'runner-a-2' + + input_filtered_search_keys('status:active runner-a') + expect(page).to have_content 'runner-a-1' + expect(page).not_to have_content 'runner-b-1' + expect(page).not_to have_content 'runner-a-2' + end end - it 'shows correct runner when status is selected and search term is entered', :js do - create(:ci_runner, description: 'runner-a-1', active: true) - create(:ci_runner, description: 'runner-a-2', active: false) - create(:ci_runner, description: 'runner-b-1', active: true) + describe 'filter by type', :js do + it 'shows correct runner when type matches' do + create :ci_runner, :project, description: 'runner-project' + create :ci_runner, :group, description: 'runner-group' - visit admin_runners_path + visit admin_runners_path + + expect(page).to have_content 'runner-project' + expect(page).to have_content 'runner-group' - input_filtered_search_keys('status:active') - expect(page).to have_content 'runner-a-1' - expect(page).to have_content 'runner-b-1' - expect(page).not_to have_content 'runner-a-2' + input_filtered_search_keys('type:project_type') + expect(page).to have_content 'runner-project' + expect(page).not_to have_content 'runner-group' + end + + it 'shows no runner when type does not match' do + create :ci_runner, :project, description: 'runner-project' + create :ci_runner, :group, description: 'runner-group' - input_filtered_search_keys('status:active runner-a') - expect(page).to have_content 'runner-a-1' - expect(page).not_to have_content 'runner-b-1' - expect(page).not_to have_content 'runner-a-2' + visit admin_runners_path + + input_filtered_search_keys('type:instance_type') + + expect(page).not_to have_content 'runner-project' + expect(page).not_to have_content 'runner-group' + + expect(page).to have_text 'No runners found' + end + + it 'shows correct runner when type is selected and search term is entered' do + create :ci_runner, :project, description: 'runner-a-1' + create :ci_runner, :instance, description: 'runner-a-2' + create :ci_runner, :project, description: 'runner-b-1' + + visit admin_runners_path + + input_filtered_search_keys('type:project_type') + expect(page).to have_content 'runner-a-1' + expect(page).to have_content 'runner-b-1' + expect(page).not_to have_content 'runner-a-2' + + input_filtered_search_keys('type:project_type runner-a') + expect(page).to have_content 'runner-a-1' + expect(page).not_to have_content 'runner-b-1' + expect(page).not_to have_content 'runner-a-2' + end end it 'sorts by last contact date', :js do |