diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-07-05 09:32:05 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-05 09:32:05 +0300 |
commit | 3db2f327594e134729a0ca2f48a748bb28ab7d6c (patch) | |
tree | 661033b988897aaf506c0deaf457c2002e17d51b /spec/features/admin | |
parent | baab4cddb091c0aa9649fecc340b8b343747ba83 (diff) |
Enable Capybara/FeatureMethods cop
Diffstat (limited to 'spec/features/admin')
-rw-r--r-- | spec/features/admin/admin_appearance_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/admin/admin_broadcast_messages_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/admin/admin_browse_spam_logs_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_cohorts_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/admin/admin_disables_git_access_protocol_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/admin/admin_disables_two_factor_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/admin/admin_groups_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/admin/admin_health_check_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_hook_logs_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 44 | ||||
-rw-r--r-- | spec/features/admin/admin_uses_repository_checks_spec.rb | 8 |
11 files changed, 66 insertions, 66 deletions
diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index a5e0ac592b9..3c2ae5b3c6a 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -feature 'Admin Appearance' do +describe 'Admin Appearance' do let!(:appearance) { create(:appearance) } - scenario 'Create new appearance' do + it 'Create new appearance' do sign_in(create(:admin)) visit admin_appearances_path @@ -21,7 +21,7 @@ feature 'Admin Appearance' do expect(page).to have_content 'Last edit' end - scenario 'Preview sign-in page appearance' do + it 'Preview sign-in page appearance' do sign_in(create(:admin)) visit admin_appearances_path @@ -30,7 +30,7 @@ feature 'Admin Appearance' do expect_custom_sign_in_appearance(appearance) end - scenario 'Preview new project page appearance' do + it 'Preview new project page appearance' do sign_in(create(:admin)) visit admin_appearances_path @@ -39,20 +39,20 @@ feature 'Admin Appearance' do expect_custom_new_project_appearance(appearance) end - scenario 'Custom sign-in page' do + it 'Custom sign-in page' do visit new_user_session_path expect_custom_sign_in_appearance(appearance) end - scenario 'Custom new project page' do + it 'Custom new project page' do sign_in create(:user) visit new_project_path expect_custom_new_project_appearance(appearance) end - scenario 'Appearance logo' do + it 'Appearance logo' do sign_in(create(:admin)) visit admin_appearances_path @@ -64,7 +64,7 @@ feature 'Admin Appearance' do expect(page).not_to have_css(logo_selector) end - scenario 'Header logos' do + it 'Header logos' do sign_in(create(:admin)) visit admin_appearances_path @@ -76,7 +76,7 @@ feature 'Admin Appearance' do expect(page).not_to have_css(header_logo_selector) end - scenario 'Favicon' do + it 'Favicon' do sign_in(create(:admin)) visit admin_appearances_path diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index 430a8d22b0f..f6dc499df29 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -1,17 +1,17 @@ require 'spec_helper' -feature 'Admin Broadcast Messages' do +describe 'Admin Broadcast Messages' do before do sign_in(create(:admin)) create(:broadcast_message, :expired, message: 'Migration to new server') visit admin_broadcast_messages_path end - scenario 'See broadcast messages list' do + it 'See broadcast messages list' do expect(page).to have_content 'Migration to new server' end - scenario 'Create a customized broadcast message' do + it 'Create a customized broadcast message' do fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**' fill_in 'broadcast_message_color', with: '#f2dede' fill_in 'broadcast_message_font', with: '#b94a48' @@ -24,7 +24,7 @@ feature 'Admin Broadcast Messages' do expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"]) end - scenario 'Edit an existing broadcast message' do + it 'Edit an existing broadcast message' do click_link 'Edit' fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' click_button 'Update broadcast message' @@ -33,14 +33,14 @@ feature 'Admin Broadcast Messages' do expect(page).to have_content 'Application update RIGHT NOW' end - scenario 'Remove an existing broadcast message' do + it 'Remove an existing broadcast message' do click_link 'Remove' expect(current_path).to eq admin_broadcast_messages_path expect(page).not_to have_content 'Migration to new server' end - scenario 'Live preview a customized broadcast message', :js do + it 'Live preview a customized broadcast message', :js do fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:" page.within('.broadcast-message-preview') do diff --git a/spec/features/admin/admin_browse_spam_logs_spec.rb b/spec/features/admin/admin_browse_spam_logs_spec.rb index 31d4142a8e9..4645fde7522 100644 --- a/spec/features/admin/admin_browse_spam_logs_spec.rb +++ b/spec/features/admin/admin_browse_spam_logs_spec.rb @@ -7,7 +7,7 @@ describe 'Admin browse spam logs' do sign_in(create(:admin)) end - scenario 'Browse spam logs' do + it 'Browse spam logs' do visit admin_spam_logs_path expect(page).to have_content('Spam Logs') diff --git a/spec/features/admin/admin_cohorts_spec.rb b/spec/features/admin/admin_cohorts_spec.rb index bca52bf674c..9dce9494b97 100644 --- a/spec/features/admin/admin_cohorts_spec.rb +++ b/spec/features/admin/admin_cohorts_spec.rb @@ -1,11 +1,11 @@ require 'rails_helper' -feature 'Admin cohorts page' do +describe 'Admin cohorts page' do before do sign_in(create(:admin)) end - scenario 'See users count per month' do + it 'See users count per month' do 2.times { create(:user) } visit admin_cohorts_path diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb index 9946cc77d1d..91c22e7ad82 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -1,22 +1,22 @@ require 'rails_helper' -feature 'Admin disables Git access protocol' do +describe 'Admin disables Git access protocol' do include StubENV let(:project) { create(:project, :empty_repo) } let(:admin) { create(:admin) } - background do + before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') sign_in(admin) end context 'with HTTP disabled' do - background do + before do disable_http_protocol end - scenario 'shows only SSH url' do + it 'shows only SSH url' do visit_project expect(page).to have_content("git clone #{project.ssh_url_to_repo}") @@ -25,11 +25,11 @@ feature 'Admin disables Git access protocol' do end context 'with SSH disabled' do - background do + before do disable_ssh_protocol end - scenario 'shows only HTTP url' do + it 'shows only HTTP url' do visit_project expect(page).to have_content("git clone #{project.http_url_to_repo}") @@ -38,11 +38,11 @@ feature 'Admin disables Git access protocol' do end context 'with nothing disabled' do - background do + before do create(:personal_key, user: admin) end - scenario 'shows default SSH url and protocol selection dropdown' do + it 'shows default SSH url and protocol selection dropdown' do visit_project expect(page).to have_content("git clone #{project.ssh_url_to_repo}") diff --git a/spec/features/admin/admin_disables_two_factor_spec.rb b/spec/features/admin/admin_disables_two_factor_spec.rb index 2abdd3c9ef2..e41835b4f24 100644 --- a/spec/features/admin/admin_disables_two_factor_spec.rb +++ b/spec/features/admin/admin_disables_two_factor_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' -feature 'Admin disables 2FA for a user' do - scenario 'successfully', :js do +describe 'Admin disables 2FA for a user' do + it 'successfully', :js do sign_in(create(:admin)) user = create(:user, :two_factor) @@ -16,7 +16,7 @@ feature 'Admin disables 2FA for a user' do end end - scenario 'for a user without 2FA enabled' do + it 'for a user without 2FA enabled' do sign_in(create(:admin)) user = create(:user) diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index a4226d7a682..5b0a53688c2 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Admin Groups' do +describe 'Admin Groups' do include Select2Helper let(:internal) { Gitlab::VisibilityLevel::INTERNAL } @@ -47,13 +47,13 @@ feature 'Admin Groups' do expect(li_texts).to match group_description end - scenario 'shows the visibility level radio populated with the default value' do + it 'shows the visibility level radio populated with the default value' do visit new_admin_group_path expect_selected_visibility(internal) end - scenario 'when entered in group path, it auto filled the group name', :js do + it 'when entered in group path, it auto filled the group name', :js do visit admin_groups_path click_link "New group" group_path = 'gitlab' @@ -64,7 +64,7 @@ feature 'Admin Groups' do end describe 'show a group' do - scenario 'shows the group' do + it 'shows the group' do group = create(:group, :private) visit admin_group_path(group) @@ -74,7 +74,7 @@ feature 'Admin Groups' do end describe 'group edit' do - scenario 'shows the visibility level radio populated with the group visibility_level value' do + it 'shows the visibility level radio populated with the group visibility_level value' do group = create(:group, :private) visit admin_group_edit_path(group) @@ -82,7 +82,7 @@ feature 'Admin Groups' do expect_selected_visibility(group.visibility_level) end - scenario 'edit group path does not change group name', :js do + it 'edit group path does not change group name', :js do group = create(:group, :private) visit admin_group_edit_path(group) diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb index 3693e5882f9..aaa3e8dc821 100644 --- a/spec/features/admin/admin_health_check_spec.rb +++ b/spec/features/admin/admin_health_check_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature "Admin Health Check", :feature do +describe "Admin Health Check", :feature do include StubENV before do diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 710822ac042..928f97b6d29 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Admin::HookLogs' do +describe 'Admin::HookLogs' do let(:project) { create(:project) } let(:system_hook) { create(:system_hook) } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } @@ -9,7 +9,7 @@ feature 'Admin::HookLogs' do sign_in(create(:admin)) end - scenario 'show list of hook logs' do + it 'show list of hook logs' do hook_log visit edit_admin_hook_path(system_hook) @@ -17,7 +17,7 @@ feature 'Admin::HookLogs' do expect(page).to have_content(hook_log.url) end - scenario 'show hook log details' do + it 'show hook log details' do hook_log visit edit_admin_hook_path(system_hook) click_link 'View details' @@ -27,7 +27,7 @@ feature 'Admin::HookLogs' do expect(page).to have_content('Resend Request') end - scenario 'retry hook log' do + it 'retry hook log' do WebMock.stub_request(:post, system_hook.url) hook_log diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index f3ab4ff771a..9c6758abe86 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Admin updates settings' do +describe 'Admin updates settings' do include StubENV include TermsHelper @@ -12,7 +12,7 @@ feature 'Admin updates settings' do visit admin_application_settings_path end - scenario 'Change visibility settings' do + it 'Change visibility settings' do page.within('.as-visibility-access') do choose "application_setting_default_project_visibility_20" click_button 'Save changes' @@ -21,7 +21,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Uncheck all restricted visibility levels' do + it 'Uncheck all restricted visibility levels' do page.within('.as-visibility-access') do find('#application_setting_visibility_level_0').set(false) find('#application_setting_visibility_level_10').set(false) @@ -35,7 +35,7 @@ feature 'Admin updates settings' do expect(find('#application_setting_visibility_level_20')).not_to be_checked end - scenario 'Modify import sources' do + it 'Modify import sources' do expect(Gitlab::CurrentSettings.import_sources).not_to be_empty page.within('.as-visibility-access') do @@ -58,7 +58,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.import_sources).to eq(['git']) end - scenario 'Change Visibility and Access Controls' do + it 'Change Visibility and Access Controls' do page.within('.as-visibility-access') do uncheck 'Project export enabled' click_button 'Save changes' @@ -68,7 +68,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Account and Limit Settings' do + it 'Change Account and Limit Settings' do page.within('.as-account-limit') do uncheck 'Gravatar enabled' click_button 'Save changes' @@ -78,7 +78,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Sign-in restrictions' do + it 'Change Sign-in restrictions' do page.within('.as-signin') do fill_in 'Home page URL', with: 'https://about.gitlab.com/' click_button 'Save changes' @@ -88,7 +88,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Terms of Service' do + it 'Terms of Service' do # Already have the admin accept terms, so they don't need to accept in this spec. _existing_terms = create(:term) accept_terms(admin) @@ -104,7 +104,7 @@ feature 'Admin updates settings' do expect(page).to have_content 'Application settings saved successfully' end - scenario 'Modify oauth providers' do + it 'Modify oauth providers' do expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty page.within('.as-signin') do @@ -124,7 +124,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).not_to include('google_oauth2') end - scenario 'Oauth providers do not raise validation errors when saving unrelated changes' do + it 'Oauth providers do not raise validation errors when saving unrelated changes' do expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty page.within('.as-signin') do @@ -147,7 +147,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to include('google_oauth2') end - scenario 'Change Help page' do + it 'Change Help page' do page.within('.as-help-page') do fill_in 'Help page text', with: 'Example text' check 'Hide marketing-related entries from help' @@ -161,7 +161,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Pages settings' do + it 'Change Pages settings' do page.within('.as-pages') do fill_in 'Maximum size of pages (MB)', with: 15 check 'Require users to prove ownership of custom domains' @@ -173,7 +173,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change CI/CD settings' do + it 'Change CI/CD settings' do page.within('.as-ci-cd') do check 'Enabled Auto DevOps for projects by default' fill_in 'Auto devops domain', with: 'domain.com' @@ -185,7 +185,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Influx settings' do + it 'Change Influx settings' do page.within('.as-influx') do check 'Enable InfluxDB Metrics' click_button 'Save changes' @@ -195,7 +195,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Prometheus settings' do + it 'Change Prometheus settings' do page.within('.as-prometheus') do check 'Enable Prometheus Metrics' click_button 'Save changes' @@ -205,7 +205,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Performance bar settings' do + it 'Change Performance bar settings' do group = create(:group) page.within('.as-performance-bar') do @@ -228,7 +228,7 @@ feature 'Admin updates settings' do expect(find_field('Allowed group').value).to be_nil end - scenario 'Change Background jobs settings' do + it 'Change Background jobs settings' do page.within('.as-background') do fill_in 'Throttling Factor', with: 1 click_button 'Save changes' @@ -238,7 +238,7 @@ feature 'Admin updates settings' do expect(page).to have_content "Application settings saved successfully" end - scenario 'Change Spam settings' do + it 'Change Spam settings' do page.within('.as-spam') do check 'Enable reCAPTCHA' fill_in 'reCAPTCHA Site Key', with: 'key' @@ -252,7 +252,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15) end - scenario 'Configure web terminal' do + it 'Configure web terminal' do page.within('.as-terminal') do fill_in 'Max session time', with: 15 click_button 'Save changes' @@ -262,7 +262,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.terminal_max_session_time).to eq(15) end - scenario 'Enable outbound requests' do + it 'Enable outbound requests' do page.within('.as-outbound') do check 'Allow requests to the local network from hooks and services' click_button 'Save changes' @@ -272,7 +272,7 @@ feature 'Admin updates settings' do expect(Gitlab::CurrentSettings.allow_local_requests_from_hooks_and_services).to be true end - scenario 'Change Slack Notifications Service template settings' do + it 'Change Slack Notifications Service template settings' do first(:link, 'Service Templates').click click_link 'Slack notifications' fill_in 'Webhook', with: 'http://localhost' @@ -296,7 +296,7 @@ feature 'Admin updates settings' do expect(find('#service_push_channel').value).to eq '#test_channel' end - scenario 'Change Keys settings' do + it 'Change Keys settings' do page.within('.as-visibility-access') do select 'Are forbidden', from: 'RSA SSH keys' select 'Are allowed', from: 'DSA SSH keys' diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index 7371a494d36..e658f1b6738 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -feature 'Admin uses repository checks' do +describe 'Admin uses repository checks' do include StubENV before do @@ -8,7 +8,7 @@ feature 'Admin uses repository checks' do sign_in(create(:admin)) end - scenario 'to trigger a single check' do + it 'to trigger a single check' do project = create(:project) visit_admin_project_page(project) @@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do expect(page).to have_content('Repository check was triggered') end - scenario 'to see a single failed repository check', :js do + it 'to see a single failed repository check', :js do project = create(:project) project.update_columns( last_repository_check_failed: true, @@ -32,7 +32,7 @@ feature 'Admin uses repository checks' do end end - scenario 'to clear all repository checks', :js do + it 'to clear all repository checks', :js do visit admin_application_settings_path expect(RepositoryCheck::ClearWorker).to receive(:perform_async) |