diff options
Diffstat (limited to 'spec/features')
650 files changed, 1986 insertions, 1045 deletions
diff --git a/spec/features/abuse_report_spec.rb b/spec/features/abuse_report_spec.rb index b1573bfb270..5959fcd6306 100644 --- a/spec/features/abuse_report_spec.rb +++ b/spec/features/abuse_report_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Abuse reports' do +RSpec.describe 'Abuse reports' do let(:another_user) { create(:user) } before do diff --git a/spec/features/action_cable_logging_spec.rb b/spec/features/action_cable_logging_spec.rb new file mode 100644 index 00000000000..ce7c0e03aad --- /dev/null +++ b/spec/features/action_cable_logging_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'ActionCable logging', :js do + let_it_be(:project) { create(:project, :public) } + let_it_be(:issue) { create(:issue, project: project) } + let_it_be(:user) { create(:user) } + + before_all do + project.add_developer(user) + end + + it 'adds extra context to logs' do + allow(ActiveSupport::Notifications).to receive(:instrument).and_call_original + + expect(ActiveSupport::Notifications).to receive(:instrument).with( + 'connect.action_cable', + a_hash_including(remote_ip: '127.0.0.1', user_id: nil, username: nil) + ) + + subscription_data = a_hash_including( + remote_ip: '127.0.0.1', + user_id: user.id, + username: user.username, + params: a_hash_including( + project_path: project.full_path, + iid: issue.iid.to_s + ) + ) + + expect(ActiveSupport::Notifications).to receive(:instrument).with('subscribe.action_cable', subscription_data) + + gitlab_sign_in(user) + visit project_issue_path(project, issue) + + # Because there is no visual indicator for Capybara to wait on before closing the browser, + # we need to test an actual feature to ensure that the subscription was already established. + + expect(page.find('.assignee')).to have_content 'None' + + fill_in 'note[note]', with: "/assign #{user.username}" + click_button 'Comment' + + expect(page.find('.assignee')).to have_content user.name + end +end diff --git a/spec/features/admin/admin_abuse_reports_spec.rb b/spec/features/admin/admin_abuse_reports_spec.rb index 93051a8a355..845e186dd5b 100644 --- a/spec/features/admin/admin_abuse_reports_spec.rb +++ b/spec/features/admin/admin_abuse_reports_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::AbuseReports", :js do +RSpec.describe "Admin::AbuseReports", :js do let(:user) { create(:user) } context 'as an admin' do diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index e711ee7d40e..48aaec6e6df 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Appearance' do +RSpec.describe 'Admin Appearance' do let!(:appearance) { create(:appearance) } it 'Create new appearance' do diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index bf7f8563e68..091ed0a3396 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Broadcast Messages' do +RSpec.describe 'Admin Broadcast Messages' do before do sign_in(create(:admin)) create(:broadcast_message, :expired, message: 'Migration to new server') diff --git a/spec/features/admin/admin_browse_spam_logs_spec.rb b/spec/features/admin/admin_browse_spam_logs_spec.rb index c79524a7fb3..65847876c11 100644 --- a/spec/features/admin/admin_browse_spam_logs_spec.rb +++ b/spec/features/admin/admin_browse_spam_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin browse spam logs' do +RSpec.describe 'Admin browse spam logs' do let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) } before do diff --git a/spec/features/admin/admin_builds_spec.rb b/spec/features/admin/admin_builds_spec.rb index afdf8eb0cca..85f0c44ed9c 100644 --- a/spec/features/admin/admin_builds_spec.rb +++ b/spec/features/admin/admin_builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Builds' do +RSpec.describe 'Admin Builds' do before do sign_in(create(:admin)) end 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 05ebb7e90d2..d7feb21a8b3 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin disables Git access protocol', :js do +RSpec.describe 'Admin disables Git access protocol', :js do include StubENV include MobileHelpers diff --git a/spec/features/admin/admin_disables_two_factor_spec.rb b/spec/features/admin/admin_disables_two_factor_spec.rb index 7227141168e..216c8ae36c7 100644 --- a/spec/features/admin/admin_disables_two_factor_spec.rb +++ b/spec/features/admin/admin_disables_two_factor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin disables 2FA for a user' do +RSpec.describe 'Admin disables 2FA for a user' do it 'successfully', :js do sign_in(create(:admin)) user = create(:user, :two_factor) diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index 1d82650d11d..9cd335ffb8c 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Groups' do +RSpec.describe 'Admin Groups' do include Select2Helper let(:internal) { Gitlab::VisibilityLevel::INTERNAL } @@ -181,7 +181,7 @@ describe 'Admin Groups' do end end - describe 'admin remove himself from a group', :js do + describe 'admin remove themself from a group', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/222342' do it 'removes admin from the group' do group.add_user(current_user, Gitlab::Access::DEVELOPER) diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb index 9ce96fe8020..dfc7f5f6f84 100644 --- a/spec/features/admin/admin_health_check_spec.rb +++ b/spec/features/admin/admin_health_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin Health Check", :feature do +RSpec.describe "Admin Health Check", :feature do include StubENV let_it_be(:admin) { create(:admin) } diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 98900142353..f4a70621cee 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::HookLogs' do +RSpec.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') } diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 40bcf4a31e4..1c14d65a1cd 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::Hooks' do +RSpec.describe 'Admin::Hooks' do let(:user) { create(:admin) } before do diff --git a/spec/features/admin/admin_mode/login_spec.rb b/spec/features/admin/admin_mode/login_spec.rb index afc6f2ddb56..4b26ceb55e2 100644 --- a/spec/features/admin/admin_mode/login_spec.rb +++ b/spec/features/admin/admin_mode/login_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include TermsHelper include UserLoginHelper include LdapHelpers diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb index e1b4aba5724..b4d49fe760f 100644 --- a/spec/features/admin/admin_mode/logout_spec.rb +++ b/spec/features/admin/admin_mode/logout_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Mode Logout', :js, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin Mode Logout', :js, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include TermsHelper include UserLoginHelper diff --git a/spec/features/admin/admin_mode/workers_spec.rb b/spec/features/admin/admin_mode/workers_spec.rb index 0ca61e6c193..d037f5555dc 100644 --- a/spec/features/admin/admin_mode/workers_spec.rb +++ b/spec/features/admin/admin_mode/workers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' # Test an operation that triggers background jobs requiring administrative rights -describe 'Admin mode for workers', :do_not_mock_admin_mode, :request_store, :clean_gitlab_redis_shared_state do +RSpec.describe 'Admin mode for workers', :do_not_mock_admin_mode, :request_store, :clean_gitlab_redis_shared_state do let(:user) { create(:user) } let(:user_to_delete) { create(:user) } diff --git a/spec/features/admin/admin_mode_spec.rb b/spec/features/admin/admin_mode_spec.rb index f642d614a5d..3b4edbc1a07 100644 --- a/spec/features/admin/admin_mode_spec.rb +++ b/spec/features/admin/admin_mode_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin mode', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin mode', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include MobileHelpers include StubENV diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index d1889d3a89a..cbaa18509ba 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::Projects" do +RSpec.describe "Admin::Projects" do include Select2Helper let(:user) { create :user } diff --git a/spec/features/admin/admin_requests_profiles_spec.rb b/spec/features/admin/admin_requests_profiles_spec.rb index e93c0ff8b20..c649fdd8e19 100644 --- a/spec/features/admin/admin_requests_profiles_spec.rb +++ b/spec/features/admin/admin_requests_profiles_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::RequestsProfilesController' do +RSpec.describe 'Admin::RequestsProfilesController' do let(:tmpdir) { Dir.mktmpdir('profiler-test') } before do diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index ca2fd2f2e9e..0e20ccf6bec 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin Runners" do +RSpec.describe "Admin Runners" do include StubENV include FilteredSearchHelpers include SortingHelper diff --git a/spec/features/admin/admin_sees_project_statistics_spec.rb b/spec/features/admin/admin_sees_project_statistics_spec.rb index ecd0aab925b..6e8211a9b4e 100644 --- a/spec/features/admin/admin_sees_project_statistics_spec.rb +++ b/spec/features/admin/admin_sees_project_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin > Admin sees project statistics" do +RSpec.describe "Admin > Admin sees project statistics" do let(:current_user) { create(:admin) } before do diff --git a/spec/features/admin/admin_sees_projects_statistics_spec.rb b/spec/features/admin/admin_sees_projects_statistics_spec.rb index 6a6f369ac7c..786fa98255c 100644 --- a/spec/features/admin/admin_sees_projects_statistics_spec.rb +++ b/spec/features/admin/admin_sees_projects_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin > Admin sees projects statistics" do +RSpec.describe "Admin > Admin sees projects statistics" do let(:current_user) { create(:admin) } before do diff --git a/spec/features/admin/admin_serverless_domains_spec.rb b/spec/features/admin/admin_serverless_domains_spec.rb index 48f6af8d4bd..256887f425f 100644 --- a/spec/features/admin/admin_serverless_domains_spec.rb +++ b/spec/features/admin/admin_serverless_domains_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Serverless Domains', :js do +RSpec.describe 'Admin Serverless Domains', :js do let(:sample_domain) { build(:pages_domain) } before do diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 7ec3c2abb51..55f6a9930ff 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -2,9 +2,10 @@ require 'spec_helper' -describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include StubENV include TermsHelper + include UsageDataHelpers let(:admin) { create(:admin) } @@ -104,6 +105,16 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc expect(page).to have_content "Application settings saved successfully" end + it 'Change Maximum import size' do + page.within('.as-account-limit') do + fill_in 'Maximum import size (MB)', with: 15 + click_button 'Save changes' + end + + expect(current_settings.max_import_size).to eq 15 + expect(page).to have_content "Application settings saved successfully" + end + it 'Change New users set to external', :js do user_internal_regex = find('#application_setting_user_default_internal_regex', visible: :all) @@ -277,16 +288,31 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end end + context 'Repository page' do + it 'Change Repository storage settings' do + visit repository_admin_application_settings_path + + page.within('.as-repository-storage') do + fill_in 'application_setting_repository_storages_weighted_default', with: 50 + click_button 'Save changes' + end + + expect(current_settings.repository_storages_weighted_default).to be 50 + end + end + context 'Reporting page' do it 'Change Spam settings' do visit reporting_admin_application_settings_path page.within('.as-spam') do - check 'Enable reCAPTCHA' - check 'Enable reCAPTCHA for login' fill_in 'reCAPTCHA Site Key', with: 'key' fill_in 'reCAPTCHA Private Key', with: 'key' + check 'Enable reCAPTCHA' + check 'Enable reCAPTCHA for login' fill_in 'IPs per user', with: 15 + check 'Enable Spam Check via external API endpoint' + fill_in 'URL of the external Spam Check endpoint', with: 'https://www.example.com/spamcheck' click_button 'Save changes' end @@ -294,6 +320,8 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc expect(current_settings.recaptcha_enabled).to be true expect(current_settings.login_recaptcha_protection_enabled).to be true expect(current_settings.unique_ips_limit_per_user).to eq(15) + expect(current_settings.spam_check_endpoint_enabled).to be true + expect(current_settings.spam_check_endpoint_url).to eq 'https://www.example.com/spamcheck' end end @@ -336,7 +364,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end it 'loads usage ping payload on click', :js do - allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + stub_usage_data_connections page.within('#js-usage-settings') do expected_payload_content = /(?=.*"uuid")(?=.*"hostname")/m @@ -377,7 +405,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc visit network_admin_application_settings_path page.within('.as-issue-limits') do - fill_in 'Max requests per second per user', with: 0 + fill_in 'Max requests per minute per user', with: 0 click_button 'Save changes' end diff --git a/spec/features/admin/admin_system_info_spec.rb b/spec/features/admin/admin_system_info_spec.rb index 3dacf63e25a..6a0448fd890 100644 --- a/spec/features/admin/admin_system_info_spec.rb +++ b/spec/features/admin/admin_system_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin System Info' do +RSpec.describe 'Admin System Info' do before do sign_in(create(:admin)) end diff --git a/spec/features/admin/admin_users_impersonation_tokens_spec.rb b/spec/features/admin/admin_users_impersonation_tokens_spec.rb index b9de858e3b9..ec3dd322f97 100644 --- a/spec/features/admin/admin_users_impersonation_tokens_spec.rb +++ b/spec/features/admin/admin_users_impersonation_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin > Users > Impersonation Tokens', :js do +RSpec.describe 'Admin > Users > Impersonation Tokens', :js do let(:admin) { create(:admin) } let!(:user) { create(:user) } diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 0c8cd895c00..369f91c6faa 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::Users" do +RSpec.describe "Admin::Users" do include Spec::Support::Helpers::Features::ResponsiveTableHelpers let!(:user) do diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index 954773e766d..b8851c28531 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin uses repository checks', :request_store, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin uses repository checks', :request_store, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include StubENV let(:admin) { create(:admin) } diff --git a/spec/features/admin/clusters/applications_spec.rb b/spec/features/admin/clusters/applications_spec.rb index 8310811b43d..3bcadfdbfc1 100644 --- a/spec/features/admin/clusters/applications_spec.rb +++ b/spec/features/admin/clusters/applications_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative '../../../../spec/features/clusters/installing_applications_shared_examples' -describe 'Instance-level Cluster Applications', :js do +RSpec.describe 'Instance-level Cluster Applications', :js do include GoogleApi::CloudPlatformHelpers let(:user) { create(:admin) } diff --git a/spec/features/admin/clusters/eks_spec.rb b/spec/features/admin/clusters/eks_spec.rb index 40561aa508c..ef49aebc7c5 100644 --- a/spec/features/admin/clusters/eks_spec.rb +++ b/spec/features/admin/clusters/eks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Instance-level AWS EKS Cluster', :js do +RSpec.describe 'Instance-level AWS EKS Cluster', :js do let(:user) { create(:admin) } before do diff --git a/spec/features/admin/dashboard_spec.rb b/spec/features/admin/dashboard_spec.rb index 018ef13cbb6..4ffa5e3be0b 100644 --- a/spec/features/admin/dashboard_spec.rb +++ b/spec/features/admin/dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'admin visits dashboard' do +RSpec.describe 'admin visits dashboard' do include ProjectForksHelper before do diff --git a/spec/features/admin/services/admin_activates_prometheus_spec.rb b/spec/features/admin/services/admin_activates_prometheus_spec.rb index 64c57cd425b..35af9dd6c68 100644 --- a/spec/features/admin/services/admin_activates_prometheus_spec.rb +++ b/spec/features/admin/services/admin_activates_prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin activates Prometheus' do +RSpec.describe 'Admin activates Prometheus', :js do let(:admin) { create(:user, :admin) } before do diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb index d523e2992db..511cdcc2940 100644 --- a/spec/features/atom/dashboard_issues_spec.rb +++ b/spec/features/atom/dashboard_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Dashboard Issues Feed" do +RSpec.describe "Dashboard Issues Feed" do describe "GET /issues" do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb index 7df0e47cd14..851ae7b02a0 100644 --- a/spec/features/atom/dashboard_spec.rb +++ b/spec/features/atom/dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Dashboard Feed" do +RSpec.describe "Dashboard Feed" do describe "GET /" do let!(:user) { create(:user, name: "Jonh") } diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index c0413f0f352..13798a94fe9 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues Feed' do +RSpec.describe 'Issues Feed' do describe 'GET /issues' do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb index 6f013e13ae4..c79b812df46 100644 --- a/spec/features/atom/users_spec.rb +++ b/spec/features/atom/users_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User Feed" do +RSpec.describe "User Feed" do describe "GET /" do let!(:user) { create(:user) } diff --git a/spec/features/boards/add_issues_modal_spec.rb b/spec/features/boards/add_issues_modal_spec.rb index 0412dc2b69c..d432825e113 100644 --- a/spec/features/boards/add_issues_modal_spec.rb +++ b/spec/features/boards/add_issues_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards add issue modal', :js do +RSpec.describe 'Issue Boards add issue modal', :js do let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index e82b1be4310..8e2a9381aa0 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards', :js do +RSpec.describe 'Issue Boards', :js do include DragTo include MobileHelpers diff --git a/spec/features/boards/focus_mode_spec.rb b/spec/features/boards/focus_mode_spec.rb index fff3cce3c1a..b1684ad69a6 100644 --- a/spec/features/boards/focus_mode_spec.rb +++ b/spec/features/boards/focus_mode_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards focus mode', :js do +RSpec.describe 'Issue Boards focus mode', :js do let(:project) { create(:project, :public) } before do diff --git a/spec/features/boards/issue_ordering_spec.rb b/spec/features/boards/issue_ordering_spec.rb index 4c723ddf324..03a76d9d3fd 100644 --- a/spec/features/boards/issue_ordering_spec.rb +++ b/spec/features/boards/issue_ordering_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards', :js do +RSpec.describe 'Issue Boards', :js do include DragTo let(:project) { create(:project, :public) } diff --git a/spec/features/boards/keyboard_shortcut_spec.rb b/spec/features/boards/keyboard_shortcut_spec.rb index 6074c559701..f51b4d21e3b 100644 --- a/spec/features/boards/keyboard_shortcut_spec.rb +++ b/spec/features/boards/keyboard_shortcut_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards shortcut', :js do +RSpec.describe 'Issue Boards shortcut', :js do context 'issues are enabled' do let(:project) { create(:project) } diff --git a/spec/features/boards/modal_filter_spec.rb b/spec/features/boards/modal_filter_spec.rb index 31f4c502c61..5aeb9eb5e50 100644 --- a/spec/features/boards/modal_filter_spec.rb +++ b/spec/features/boards/modal_filter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards add issue modal filtering', :js do +RSpec.describe 'Issue Boards add issue modal filtering', :js do let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let(:planning) { create(:label, project: project, name: 'Planning') } diff --git a/spec/features/boards/multi_select_spec.rb b/spec/features/boards/multi_select_spec.rb index 885dc08e38d..162455f75e6 100644 --- a/spec/features/boards/multi_select_spec.rb +++ b/spec/features/boards/multi_select_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multi Select Issue', :js do +RSpec.describe 'Multi Select Issue', :js do include DragTo let(:group) { create(:group, :nested) } diff --git a/spec/features/boards/multiple_boards_spec.rb b/spec/features/boards/multiple_boards_spec.rb index 8e56be6bdd0..2894d5c7666 100644 --- a/spec/features/boards/multiple_boards_spec.rb +++ b/spec/features/boards/multiple_boards_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multiple Issue Boards', :js do +RSpec.describe 'Multiple Issue Boards', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public) } let_it_be(:planning) { create(:label, project: project, name: 'Planning') } diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index 2d41b5d612d..efa1f8cfc0d 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards new issue', :js do +RSpec.describe 'Issue Boards new issue', :js do let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let!(:list) { create(:list, board: board, position: 0) } diff --git a/spec/features/boards/reload_boards_on_browser_back_spec.rb b/spec/features/boards/reload_boards_on_browser_back_spec.rb index 6528b8f58bb..181cbcc9811 100644 --- a/spec/features/boards/reload_boards_on_browser_back_spec.rb +++ b/spec/features/boards/reload_boards_on_browser_back_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Ensure Boards do not show stale data on browser back', :js do +RSpec.describe 'Ensure Boards do not show stale data on browser back', :js do let(:project) {create(:project, :public)} let(:board) {create(:board, project: project)} let(:user) {create(:user)} diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index d05709b7e2f..65f2e5dfc0d 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Boards', :js do +RSpec.describe 'Issue Boards', :js do include BoardHelpers include FilteredSearchHelpers diff --git a/spec/features/boards/sub_group_project_spec.rb b/spec/features/boards/sub_group_project_spec.rb index 4384a1a9379..cd3d61726f6 100644 --- a/spec/features/boards/sub_group_project_spec.rb +++ b/spec/features/boards/sub_group_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Sub-group project issue boards', :js do +RSpec.describe 'Sub-group project issue boards', :js do let(:group) { create(:group) } let(:nested_group_1) { create(:group, parent: group) } let(:project) { create(:project, group: nested_group_1) } diff --git a/spec/features/broadcast_messages_spec.rb b/spec/features/broadcast_messages_spec.rb index c770e6e4f81..f339d45671d 100644 --- a/spec/features/broadcast_messages_spec.rb +++ b/spec/features/broadcast_messages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Broadcast Messages' do +RSpec.describe 'Broadcast Messages' do let_it_be(:user) { create(:user) } shared_examples 'a Broadcast Messages' do |type| diff --git a/spec/features/calendar_spec.rb b/spec/features/calendar_spec.rb index acdc38038aa..5b78d93ae04 100644 --- a/spec/features/calendar_spec.rb +++ b/spec/features/calendar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Contributions Calendar', :js do +RSpec.describe 'Contributions Calendar', :js do include MobileHelpers let(:user) { create(:user) } @@ -59,7 +59,7 @@ describe 'Contributions Calendar', :js do def note_comment_contribution note_comment_params = { project: contributed_project, - action: Event::COMMENTED, + action: :commented, target: issue_note, author_id: user.id } diff --git a/spec/features/clusters/cluster_detail_page_spec.rb b/spec/features/clusters/cluster_detail_page_spec.rb index 4b478163952..6058c35c2cf 100644 --- a/spec/features/clusters/cluster_detail_page_spec.rb +++ b/spec/features/clusters/cluster_detail_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Clusterable > Show page' do +RSpec.describe 'Clusterable > Show page' do include KubernetesHelpers let(:current_user) { create(:user) } diff --git a/spec/features/clusters/installing_applications_shared_examples.rb b/spec/features/clusters/installing_applications_shared_examples.rb index 5b565c0a304..d2f28f5b219 100644 --- a/spec/features/clusters/installing_applications_shared_examples.rb +++ b/spec/features/clusters/installing_applications_shared_examples.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -shared_examples "installing applications for a cluster" do |managed_apps_local_tiller| +RSpec.shared_examples "installing applications for a cluster" do |managed_apps_local_tiller| before do stub_feature_flags(managed_apps_local_tiller: managed_apps_local_tiller) @@ -279,7 +279,7 @@ shared_examples "installing applications for a cluster" do |managed_apps_local_t end end -shared_examples "installing applications on a cluster" do +RSpec.shared_examples "installing applications on a cluster" do it_behaves_like "installing applications for a cluster", false it_behaves_like "installing applications for a cluster", true end diff --git a/spec/features/commits/user_uses_quick_actions_spec.rb b/spec/features/commits/user_uses_quick_actions_spec.rb index 70ea920b7ec..12e7865e490 100644 --- a/spec/features/commits/user_uses_quick_actions_spec.rb +++ b/spec/features/commits/user_uses_quick_actions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Commit > User uses quick actions', :js do +RSpec.describe 'Commit > User uses quick actions', :js do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/commits/user_view_commits_spec.rb b/spec/features/commits/user_view_commits_spec.rb index 133baca8b1c..5907534220d 100644 --- a/spec/features/commits/user_view_commits_spec.rb +++ b/spec/features/commits/user_view_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Commit > User view commits' do +RSpec.describe 'Commit > User view commits' do let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:user) { project.creator } diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index d8b886b239f..60c37d1e125 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Commits' do +RSpec.describe 'Commits' do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user) } diff --git a/spec/features/contextual_sidebar_spec.rb b/spec/features/contextual_sidebar_spec.rb index e250e8cc90a..8ea1ebac6b7 100644 --- a/spec/features/contextual_sidebar_spec.rb +++ b/spec/features/contextual_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Contextual sidebar', :js do +RSpec.describe 'Contextual sidebar', :js do let(:user) { create(:user) } let(:project) { create(:project) } diff --git a/spec/features/cycle_analytics_spec.rb b/spec/features/cycle_analytics_spec.rb index 50d9cb1c833..0294ebbe13f 100644 --- a/spec/features/cycle_analytics_spec.rb +++ b/spec/features/cycle_analytics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Value Stream Analytics', :js do +RSpec.describe 'Value Stream Analytics', :js do let(:user) { create(:user) } let(:guest) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/dashboard/activity_spec.rb b/spec/features/dashboard/activity_spec.rb index 0a3b550c0c4..b419a063858 100644 --- a/spec/features/dashboard/activity_spec.rb +++ b/spec/features/dashboard/activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > Activity' do +RSpec.describe 'Dashboard > Activity' do let(:user) { create(:user) } before do diff --git a/spec/features/dashboard/datetime_on_tooltips_spec.rb b/spec/features/dashboard/datetime_on_tooltips_spec.rb index 56b47b74626..ed28ec6099d 100644 --- a/spec/features/dashboard/datetime_on_tooltips_spec.rb +++ b/spec/features/dashboard/datetime_on_tooltips_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Tooltips on .timeago dates', :js do +RSpec.describe 'Tooltips on .timeago dates', :js do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:created_date) { Date.yesterday.to_time } @@ -12,7 +12,7 @@ describe 'Tooltips on .timeago dates', :js do before do project.add_maintainer(user) - Event.create( project: project, author_id: user.id, action: Event::JOINED, + Event.create( project: project, author_id: user.id, action: :joined, updated_at: created_date, created_at: created_date) sign_in user diff --git a/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb b/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb index aebc2eb1916..c2a3b90b6f4 100644 --- a/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb +++ b/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'The group dashboard' do +RSpec.describe 'The group dashboard' do include ExternalAuthorizationServiceHelpers let(:user) { create(:user) } diff --git a/spec/features/dashboard/groups_list_spec.rb b/spec/features/dashboard/groups_list_spec.rb index 5b336f994f7..8c941b27cd2 100644 --- a/spec/features/dashboard/groups_list_spec.rb +++ b/spec/features/dashboard/groups_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Groups page', :js do +RSpec.describe 'Dashboard Groups page', :js do let(:user) { create :user } let(:group) { create(:group) } let(:nested_group) { create(:group, :nested) } diff --git a/spec/features/dashboard/instance_statistics_spec.rb b/spec/features/dashboard/instance_statistics_spec.rb index feb568d8ef4..f85b8454113 100644 --- a/spec/features/dashboard/instance_statistics_spec.rb +++ b/spec/features/dashboard/instance_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Showing analytics' do +RSpec.describe 'Showing analytics' do before do sign_in user if user end diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb index eca78749171..7526a55a3c1 100644 --- a/spec/features/dashboard/issuables_counter_spec.rb +++ b/spec/features/dashboard/issuables_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Navigation bar counter', :use_clean_rails_memory_store_caching do +RSpec.describe 'Navigation bar counter', :use_clean_rails_memory_store_caching do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb index 8e2a3d983b1..4bd00bd0a80 100644 --- a/spec/features/dashboard/issues_filter_spec.rb +++ b/spec/features/dashboard/issues_filter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Issues filtering', :js do +RSpec.describe 'Dashboard Issues filtering', :js do include Spec::Support::Helpers::Features::SortingHelpers include FilteredSearchHelpers diff --git a/spec/features/dashboard/label_filter_spec.rb b/spec/features/dashboard/label_filter_spec.rb index 630b2b636b4..ebe5c3e1091 100644 --- a/spec/features/dashboard/label_filter_spec.rb +++ b/spec/features/dashboard/label_filter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > label filter', :js do +RSpec.describe 'Dashboard > label filter', :js do include FilteredSearchHelpers let(:filtered_search) { find('.filtered-search') } diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index 0c728ab22de..5331b5559d8 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Merge Requests' do +RSpec.describe 'Dashboard Merge Requests' do include Spec::Support::Helpers::Features::SortingHelpers include FilteredSearchHelpers include ProjectForksHelper diff --git a/spec/features/dashboard/milestone_tabs_spec.rb b/spec/features/dashboard/milestone_tabs_spec.rb deleted file mode 100644 index a83e4c1f7c9..00000000000 --- a/spec/features/dashboard/milestone_tabs_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'Dashboard milestone tabs', :js do - let(:user) { create(:user) } - let(:project) { create(:project) } - let!(:label) { create(:label, project: project) } - let(:project_milestone) { create(:milestone, project: project) } - let(:milestone) do - DashboardMilestone.build( - [project], - project_milestone.title - ) - end - let!(:merge_request) { create(:labeled_merge_request, source_project: project, target_project: project, milestone: project_milestone, labels: [label]) } - - before do - project.add_maintainer(user) - sign_in(user) - - visit dashboard_milestone_path(milestone.safe_title, title: milestone.title) - end - - it 'loads merge requests async' do - click_link 'Merge Requests' - - expect(page).to have_selector('.milestone-merge_requests-list') - end - - it 'loads participants async' do - click_link 'Participants' - - expect(page).to have_selector('#tab-participants .bordered-list') - end - - it 'loads labels async' do - click_link 'Labels' - - expect(page).to have_selector('#tab-labels .bordered-list') - end -end diff --git a/spec/features/dashboard/milestones_spec.rb b/spec/features/dashboard/milestones_spec.rb index 4ad19710d90..308432b7a1b 100644 --- a/spec/features/dashboard/milestones_spec.rb +++ b/spec/features/dashboard/milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > Milestones' do +RSpec.describe 'Dashboard > Milestones' do describe 'as anonymous user' do before do visit dashboard_milestones_path diff --git a/spec/features/dashboard/project_member_activity_index_spec.rb b/spec/features/dashboard/project_member_activity_index_spec.rb index 8e7a0b2a611..6e6e466294f 100644 --- a/spec/features/dashboard/project_member_activity_index_spec.rb +++ b/spec/features/dashboard/project_member_activity_index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project member activity', :js do +RSpec.describe 'Project member activity', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) } @@ -18,7 +18,7 @@ describe 'Project member activity', :js do context 'when a user joins the project' do before do - visit_activities_and_wait_with_event(Event::JOINED) + visit_activities_and_wait_with_event(:joined) end it "presents the correct message" do @@ -29,7 +29,7 @@ describe 'Project member activity', :js do context 'when a user leaves the project' do before do - visit_activities_and_wait_with_event(Event::LEFT) + visit_activities_and_wait_with_event(:left) end it "presents the correct message" do @@ -40,7 +40,7 @@ describe 'Project member activity', :js do context 'when a users membership expires for the project' do before do - visit_activities_and_wait_with_event(Event::EXPIRED) + visit_activities_and_wait_with_event(:expired) end it "presents the correct message" do diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 218cbf871a9..e1beaf923e8 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Projects' do +RSpec.describe 'Dashboard Projects' do let(:user) { create(:user) } let(:project) { create(:project, :repository, name: 'awesome stuff') } let(:project2) { create(:project, :public, name: 'Community project') } @@ -125,7 +125,7 @@ describe 'Dashboard Projects' do end context 'when on Starred projects tab', :js do - it 'shows the empty state when there are no starred projects' do + it 'shows the empty state when there are no starred projects', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/222357' do visit(starred_dashboard_projects_path) element = page.find('.row.empty-state') diff --git a/spec/features/dashboard/root_explore_spec.rb b/spec/features/dashboard/root_explore_spec.rb index 0e065dbed67..a3c346ffe2a 100644 --- a/spec/features/dashboard/root_explore_spec.rb +++ b/spec/features/dashboard/root_explore_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Root explore' do +RSpec.describe 'Root explore' do let_it_be(:public_project) { create(:project, :public) } let_it_be(:archived_project) { create(:project, :archived) } let_it_be(:internal_project) { create(:project, :internal) } diff --git a/spec/features/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb index 6907c681417..04bbc3059de 100644 --- a/spec/features/dashboard/shortcuts_spec.rb +++ b/spec/features/dashboard/shortcuts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard shortcuts', :js do +RSpec.describe 'Dashboard shortcuts', :js do context 'logged in' do let(:user) { create(:user) } let(:project) { create(:project) } diff --git a/spec/features/dashboard/snippets_spec.rb b/spec/features/dashboard/snippets_spec.rb index 94aef03e093..224f2111014 100644 --- a/spec/features/dashboard/snippets_spec.rb +++ b/spec/features/dashboard/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard snippets' do +RSpec.describe 'Dashboard snippets' do let_it_be(:user) { create(:user) } context 'when the project has snippets' do diff --git a/spec/features/dashboard/todos/target_state_spec.rb b/spec/features/dashboard/todos/target_state_spec.rb index 0ea1f43e34b..4c43948201c 100644 --- a/spec/features/dashboard/todos/target_state_spec.rb +++ b/spec/features/dashboard/todos/target_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > Todo target states' do +RSpec.describe 'Dashboard > Todo target states' do let(:user) { create(:user) } let(:author) { create(:user) } let(:project) { create(:project, :public) } diff --git a/spec/features/dashboard/todos/todos_filtering_spec.rb b/spec/features/dashboard/todos/todos_filtering_spec.rb index efa163042f9..f60b07c976e 100644 --- a/spec/features/dashboard/todos/todos_filtering_spec.rb +++ b/spec/features/dashboard/todos/todos_filtering_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > User filters todos', :js do +RSpec.describe 'Dashboard > User filters todos', :js do let(:user_1) { create(:user, username: 'user_1', name: 'user_1') } let(:user_2) { create(:user, username: 'user_2', name: 'user_2') } diff --git a/spec/features/dashboard/todos/todos_sorting_spec.rb b/spec/features/dashboard/todos/todos_sorting_spec.rb index 421a66c6d48..d0f9a2b35f3 100644 --- a/spec/features/dashboard/todos/todos_sorting_spec.rb +++ b/spec/features/dashboard/todos/todos_sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > User sorts todos' do +RSpec.describe 'Dashboard > User sorts todos' do let(:user) { create(:user) } let(:project) { create(:project) } diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb index 63867d5796a..cf773d2caed 100644 --- a/spec/features/dashboard/todos/todos_spec.rb +++ b/spec/features/dashboard/todos/todos_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Todos' do +RSpec.describe 'Dashboard Todos' do let_it_be(:user) { create(:user, username: 'john') } let_it_be(:author) { create(:user) } let_it_be(:project) { create(:project, :public) } @@ -114,7 +114,7 @@ describe 'Dashboard Todos' do context 'todo is stale on the page' do before do todos = TodosFinder.new(user, state: :pending).execute - TodoService.new.mark_todos_as_done(todos, user) + TodoService.new.resolve_todos(todos, user) end it_behaves_like 'deleting the todo' diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb index c4e4eb8affe..832f50932f4 100644 --- a/spec/features/dashboard/user_filters_projects_spec.rb +++ b/spec/features/dashboard/user_filters_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard > User filters projects' do +RSpec.describe 'Dashboard > User filters projects' do let(:user) { create(:user) } let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace, created_at: 2.seconds.ago, updated_at: 2.seconds.ago) } let(:user2) { create(:user) } diff --git a/spec/features/discussion_comments/commit_spec.rb b/spec/features/discussion_comments/commit_spec.rb index f594a30165b..5a744e43bb6 100644 --- a/spec/features/discussion_comments/commit_spec.rb +++ b/spec/features/discussion_comments/commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Thread Comments Commit', :js do +RSpec.describe 'Thread Comments Commit', :js do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb index fbceb2a51ae..2ad77a2884c 100644 --- a/spec/features/discussion_comments/issue_spec.rb +++ b/spec/features/discussion_comments/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Thread Comments Issue', :js do +RSpec.describe 'Thread Comments Issue', :js do let(:user) { create(:user) } let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/discussion_comments/merge_request_spec.rb b/spec/features/discussion_comments/merge_request_spec.rb index c5457522c8e..43801b30608 100644 --- a/spec/features/discussion_comments/merge_request_spec.rb +++ b/spec/features/discussion_comments/merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Thread Comments Merge Request', :js do +RSpec.describe 'Thread Comments Merge Request', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb index bf78a5261c5..50201bbdb21 100644 --- a/spec/features/discussion_comments/snippets_spec.rb +++ b/spec/features/discussion_comments/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Thread Comments Snippet', :js do +RSpec.describe 'Thread Comments Snippet', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:snippet) { create(:project_snippet, :private, :repository, project: project, author: user) } diff --git a/spec/features/display_system_header_and_footer_bar_spec.rb b/spec/features/display_system_header_and_footer_bar_spec.rb index e32da1a02bc..0979371a574 100644 --- a/spec/features/display_system_header_and_footer_bar_spec.rb +++ b/spec/features/display_system_header_and_footer_bar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Display system header and footer bar' do +RSpec.describe 'Display system header and footer bar' do let(:header_message) { "Foo" } let(:footer_message) { "Bar" } diff --git a/spec/features/error_pages_spec.rb b/spec/features/error_pages_spec.rb index 562277388bb..77f8aa87237 100644 --- a/spec/features/error_pages_spec.rb +++ b/spec/features/error_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Error Pages' do +RSpec.describe 'Error Pages' do let(:user) { create(:user) } let(:project) { create(:project, :public) } diff --git a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb index 4b5bc16c4db..a0d93b791d9 100644 --- a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb +++ b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'When a user filters Sentry errors by status', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do +RSpec.describe 'When a user filters Sentry errors by status', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb index c5559081feb..025a6261957 100644 --- a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb +++ b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do +RSpec.describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/error_tracking/user_sees_error_details_spec.rb b/spec/features/error_tracking/user_sees_error_details_spec.rb index 6f72c44c689..e4a09d04ca1 100644 --- a/spec/features/error_tracking/user_sees_error_details_spec.rb +++ b/spec/features/error_tracking/user_sees_error_details_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'View error details page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do +RSpec.describe 'View error details page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do include_context 'sentry error tracking context feature' context 'with current user as project owner' do diff --git a/spec/features/error_tracking/user_sees_error_index_spec.rb b/spec/features/error_tracking/user_sees_error_index_spec.rb index 34a3a4b5a49..a4b15432ef3 100644 --- a/spec/features/error_tracking/user_sees_error_index_spec.rb +++ b/spec/features/error_tracking/user_sees_error_index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'View error index page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do +RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 4bd2a305dfa..6b8df8467e5 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Expand and collapse diffs', :js do +RSpec.describe 'Expand and collapse diffs', :js do let(:branch) { 'expand-collapse-diffs' } let(:project) { create(:project, :repository) } diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb index c14144ab3d5..ba09cc20154 100644 --- a/spec/features/explore/groups_list_spec.rb +++ b/spec/features/explore/groups_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Explore Groups page', :js do +RSpec.describe 'Explore Groups page', :js do let!(:user) { create :user } let!(:group) { create(:group) } let!(:public_group) { create(:group, :public) } diff --git a/spec/features/explore/groups_spec.rb b/spec/features/explore/groups_spec.rb index aee0a7c5573..6e9749f29c3 100644 --- a/spec/features/explore/groups_spec.rb +++ b/spec/features/explore/groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Explore Groups', :js do +RSpec.describe 'Explore Groups', :js do let(:user) { create :user } let(:group) { create :group } let!(:private_project) do diff --git a/spec/features/explore/user_explores_projects_spec.rb b/spec/features/explore/user_explores_projects_spec.rb index 6adf51a1cf6..e217638f62b 100644 --- a/spec/features/explore/user_explores_projects_spec.rb +++ b/spec/features/explore/user_explores_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User explores projects' do +RSpec.describe 'User explores projects' do let_it_be(:archived_project) { create(:project, :archived) } let_it_be(:internal_project) { create(:project, :internal) } let_it_be(:private_project) { create(:project, :private) } diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb index a7c8c29517e..c878ee7329f 100644 --- a/spec/features/global_search_spec.rb +++ b/spec/features/global_search_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Global search' do +RSpec.describe 'Global search' do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } @@ -14,7 +14,8 @@ describe 'Global search' do end it 'increases usage ping searches counter' do - expect(Gitlab::UsageDataCounters::SearchCounter).to receive(:increment_navbar_searches_count) + expect(Gitlab::UsageDataCounters::SearchCounter).to receive(:count).with(:navbar_searches) + expect(Gitlab::UsageDataCounters::SearchCounter).to receive(:count).with(:all_searches) submit_search('foobar') end diff --git a/spec/features/graphiql_spec.rb b/spec/features/graphiql_spec.rb index 329758113ab..91f53b4bb7c 100644 --- a/spec/features/graphiql_spec.rb +++ b/spec/features/graphiql_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'GraphiQL' do +RSpec.describe 'GraphiQL' do context 'without relative_url_root' do before do visit '/-/graphql-explorer' diff --git a/spec/features/group_variables_spec.rb b/spec/features/group_variables_spec.rb index 524ae837b5e..9a3dca61680 100644 --- a/spec/features/group_variables_spec.rb +++ b/spec/features/group_variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group variables', :js do +RSpec.describe 'Group variables', :js do let(:user) { create(:user) } let(:group) { create(:group) } let!(:variable) { create(:ci_group_variable, key: 'test_key', value: 'test_value', masked: true, group: group) } diff --git a/spec/features/groups/activity_spec.rb b/spec/features/groups/activity_spec.rb index c102e19d477..6ca69e76d33 100644 --- a/spec/features/groups/activity_spec.rb +++ b/spec/features/groups/activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group activity page' do +RSpec.describe 'Group activity page' do let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:group) { create(:group) } let(:path) { activity_group_path(group) } diff --git a/spec/features/groups/board_sidebar_spec.rb b/spec/features/groups/board_sidebar_spec.rb index ed874141ef4..3bbeed10948 100644 --- a/spec/features/groups/board_sidebar_spec.rb +++ b/spec/features/groups/board_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Issue Boards', :js do +RSpec.describe 'Group Issue Boards', :js do include BoardHelpers let(:group) { create(:group) } diff --git a/spec/features/groups/board_spec.rb b/spec/features/groups/board_spec.rb index f95e2e91cd7..29d0347086c 100644 --- a/spec/features/groups/board_spec.rb +++ b/spec/features/groups/board_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Boards' do +RSpec.describe 'Group Boards' do let(:group) { create(:group) } let!(:project) { create(:project_empty_repo, group: group) } let(:user) { create(:group_member, :maintainer, user: create(:user), group: group ).user } diff --git a/spec/features/groups/clusters/applications_spec.rb b/spec/features/groups/clusters/applications_spec.rb index 5d48df234eb..324ef24efc4 100644 --- a/spec/features/groups/clusters/applications_spec.rb +++ b/spec/features/groups/clusters/applications_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative '../../../../spec/features/clusters/installing_applications_shared_examples' -describe 'Group-level Cluster Applications', :js do +RSpec.describe 'Group-level Cluster Applications', :js do include GoogleApi::CloudPlatformHelpers let(:group) { create(:group) } diff --git a/spec/features/groups/clusters/eks_spec.rb b/spec/features/groups/clusters/eks_spec.rb index a9267d58739..5a62741250a 100644 --- a/spec/features/groups/clusters/eks_spec.rb +++ b/spec/features/groups/clusters/eks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group AWS EKS Cluster', :js do +RSpec.describe 'Group AWS EKS Cluster', :js do let(:group) { create(:group) } let(:user) { create(:user) } diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb index a29afba99e4..c6e5da92160 100644 --- a/spec/features/groups/clusters/user_spec.rb +++ b/spec/features/groups/clusters/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User Cluster', :js do +RSpec.describe 'User Cluster', :js do include GoogleApi::CloudPlatformHelpers let(:group) { create(:group) } diff --git a/spec/features/groups/container_registry_spec.rb b/spec/features/groups/container_registry_spec.rb index 7e3c1728f3c..87ef2131211 100644 --- a/spec/features/groups/container_registry_spec.rb +++ b/spec/features/groups/container_registry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Container Registry', :js do +RSpec.describe 'Container Registry', :js do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } @@ -24,6 +24,13 @@ describe 'Container Registry', :js do expect(page).to have_title _('Container Registry') end + it 'sidebar menu is open' do + visit_container_registry + + sidebar = find('.nav-sidebar') + expect(sidebar).to have_link _('Container Registry') + end + context 'when there are no image repositories' do it 'list page has no container title' do visit_container_registry @@ -75,7 +82,7 @@ describe 'Container Registry', :js do expect(service).to receive(:execute).with(container_repository) { { status: :success } } expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(container_repository.project, user, tags: ['latest']) { service } - click_on(class: 'js-delete-registry') + first('[data-testid="singleDeleteButton"]').click expect(find('.modal .modal-title')).to have_content _('Remove tag') find('.modal .modal-footer .btn-danger').click end diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index bbc80b7eec4..d76cf993004 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group empty states' do +RSpec.describe 'Group empty states' do let(:group) { create(:group) } let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } diff --git a/spec/features/groups/group_page_with_external_authorization_service_spec.rb b/spec/features/groups/group_page_with_external_authorization_service_spec.rb index a71b930d35f..8ef1b60d8ca 100644 --- a/spec/features/groups/group_page_with_external_authorization_service_spec.rb +++ b/spec/features/groups/group_page_with_external_authorization_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'The group page' do +RSpec.describe 'The group page' do include ExternalAuthorizationServiceHelpers let(:user) { create(:user) } diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index d686e0ed9d2..8972be45acb 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Edit group settings' do +RSpec.describe 'Edit group settings' do let(:user) { create(:user) } let(:group) { create(:group, path: 'foo') } diff --git a/spec/features/groups/import_export/export_file_spec.rb b/spec/features/groups/import_export/export_file_spec.rb index 5829e659722..9feb8085e66 100644 --- a/spec/features/groups/import_export/export_file_spec.rb +++ b/spec/features/groups/import_export/export_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Export', :js do +RSpec.describe 'Group Export', :js do include ExportFileHelper let_it_be(:user) { create(:user) } diff --git a/spec/features/groups/import_export/import_file_spec.rb b/spec/features/groups/import_export/import_file_spec.rb new file mode 100644 index 00000000000..577198ef3f1 --- /dev/null +++ b/spec/features/groups/import_export/import_file_spec.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Import/Export - Group Import', :js do + let_it_be(:user) { create(:user) } + let_it_be(:import_path) { "#{Dir.tmpdir}/group_import_spec" } + + before do + allow_next_instance_of(Gitlab::ImportExport) do |import_export| + allow(import_export).to receive(:storage_path).and_return(import_path) + end + + stub_uploads_object_storage(FileUploader) + + gitlab_sign_in(user) + end + + after do + FileUtils.rm_rf(import_path, secure: true) + end + + context 'when the user uploads a valid export file' do + let(:file) { File.join(Rails.root, 'spec', %w[fixtures group_export.tar.gz]) } + + context 'when using the pre-filled path', :sidekiq_inline do + it 'successfully imports the group' do + group_name = 'Test Group Import' + + visit new_group_path + + fill_in :group_name, with: group_name + find('#import-group-tab').click + + expect(page).to have_content 'GitLab group export' + attach_file(file) do + find('.js-filepicker-button').click + end + + expect { click_on 'Import group' }.to change { Group.count }.by 1 + + group = Group.find_by(name: group_name) + + expect(group).not_to be_nil + expect(group.description).to eq 'A voluptate non sequi temporibus quam at.' + expect(group.path).to eq 'test-group-import' + expect(group.import_state.status).to eq GroupImportState.state_machine.states[:finished].value + end + end + + context 'when modifying the pre-filled path' do + it 'successfully imports the group' do + visit new_group_path + + fill_in :group_name, with: 'Test Group Import' + find('#import-group-tab').click + + fill_in :import_group_path, with: 'custom-path' + attach_file(file) do + find('.js-filepicker-button').click + end + + expect { click_on 'Import group' }.to change { Group.count }.by 1 + + group = Group.find_by(name: 'Test Group Import') + expect(group.path).to eq 'custom-path' + end + end + + context 'when the path is already taken' do + before do + create(:group, path: 'test-group-import') + end + + it 'suggests a unique path' do + visit new_group_path + find('#import-group-tab').click + + fill_in :import_group_path, with: 'test-group-import' + expect(page).to have_content 'Group path is already taken. Suggestions: test-group-import1' + end + end + end + + context 'when the user uploads an invalid export file' do + let(:file) { File.join(Rails.root, 'spec', %w[fixtures big-image.png]) } + + it 'displays an error' do + visit new_group_path + + fill_in :group_name, with: 'Test Group Import' + find('#import-group-tab').click + attach_file(file) do + find('.js-filepicker-button').click + end + + expect { click_on 'Import group' }.not_to change { Group.count } + + page.within('.flash-container') do + expect(page).to have_content('Unable to process group import file') + end + end + end +end diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb index 1cefcd18989..c76e0c311a6 100644 --- a/spec/features/groups/issues_spec.rb +++ b/spec/features/groups/issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group issues page' do +RSpec.describe 'Group issues page' do include FilteredSearchHelpers include DragTo diff --git a/spec/features/groups/labels/create_spec.rb b/spec/features/groups/labels/create_spec.rb index f5062a65321..9c1a3672ebd 100644 --- a/spec/features/groups/labels/create_spec.rb +++ b/spec/features/groups/labels/create_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Create a group label' do +RSpec.describe 'Create a group label' do let(:user) { create(:user) } let(:group) { create(:group) } diff --git a/spec/features/groups/labels/edit_spec.rb b/spec/features/groups/labels/edit_spec.rb index 43f067b89d6..2be7f61eeb9 100644 --- a/spec/features/groups/labels/edit_spec.rb +++ b/spec/features/groups/labels/edit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Edit group label' do +RSpec.describe 'Edit group label' do let(:user) { create(:user) } let(:group) { create(:group) } let(:label) { create(:group_label, group: group) } diff --git a/spec/features/groups/labels/index_spec.rb b/spec/features/groups/labels/index_spec.rb index 62308d3b518..3de29231f5c 100644 --- a/spec/features/groups/labels/index_spec.rb +++ b/spec/features/groups/labels/index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group labels' do +RSpec.describe 'Group labels' do let(:user) { create(:user) } let(:group) { create(:group) } let!(:label) { create(:group_label, group: group) } diff --git a/spec/features/groups/labels/search_labels_spec.rb b/spec/features/groups/labels/search_labels_spec.rb index 14b88a561b1..fbb0acfb923 100644 --- a/spec/features/groups/labels/search_labels_spec.rb +++ b/spec/features/groups/labels/search_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Search for labels', :js do +RSpec.describe 'Search for labels', :js do let(:user) { create(:user) } let(:group) { create(:group) } let!(:label1) { create(:group_label, title: 'Foo', description: 'Lorem ipsum', group: group) } diff --git a/spec/features/groups/labels/sort_labels_spec.rb b/spec/features/groups/labels/sort_labels_spec.rb index 2aea4d77675..b5657db23cb 100644 --- a/spec/features/groups/labels/sort_labels_spec.rb +++ b/spec/features/groups/labels/sort_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Sort labels', :js do +RSpec.describe 'Sort labels', :js do let(:user) { create(:user) } let(:group) { create(:group) } let!(:label1) { create(:group_label, title: 'Foo', description: 'Lorem ipsum', group: group) } diff --git a/spec/features/groups/labels/subscription_spec.rb b/spec/features/groups/labels/subscription_spec.rb index cbccf4f3880..dedded777ac 100644 --- a/spec/features/groups/labels/subscription_spec.rb +++ b/spec/features/groups/labels/subscription_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Labels subscription' do +RSpec.describe 'Labels subscription' do let(:user) { create(:user) } let(:group) { create(:group) } let!(:label1) { create(:group_label, group: group, title: 'foo') } diff --git a/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb b/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb index 38561c71323..b0508633065 100644 --- a/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb +++ b/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Labels > User sees links to issuables' do +RSpec.describe 'Groups > Labels > User sees links to issuables' do let_it_be(:group) { create(:group, :public) } before do diff --git a/spec/features/groups/members/filter_members_spec.rb b/spec/features/groups/members/filter_members_spec.rb index cba86f7e651..643c8407578 100644 --- a/spec/features/groups/members/filter_members_spec.rb +++ b/spec/features/groups/members/filter_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Filter members' do +RSpec.describe 'Groups > Members > Filter members' do let(:user) { create(:user) } let(:nested_group_user) { create(:user) } let(:user_with_2fa) { create(:user, :two_factor_via_otp) } diff --git a/spec/features/groups/members/leave_group_spec.rb b/spec/features/groups/members/leave_group_spec.rb index 5c7c83aea6d..fecc90f20c7 100644 --- a/spec/features/groups/members/leave_group_spec.rb +++ b/spec/features/groups/members/leave_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Leave group' do +RSpec.describe 'Groups > Members > Leave group' do let(:user) { create(:user) } let(:other_user) { create(:user) } let(:group) { create(:group) } @@ -31,6 +31,7 @@ describe 'Groups > Members > Leave group' do page.accept_confirm + wait_for_all_requests expect(current_path).to eq(dashboard_groups_path) expect(group.users).not_to include(user) end diff --git a/spec/features/groups/members/list_members_spec.rb b/spec/features/groups/members/list_members_spec.rb index 8df807186be..415c6927320 100644 --- a/spec/features/groups/members/list_members_spec.rb +++ b/spec/features/groups/members/list_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > List members' do +RSpec.describe 'Groups > Members > List members' do include Select2Helper include Spec::Support::Helpers::Features::ListRowsHelpers diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb index 593c450c6d6..f1cf04417c0 100644 --- a/spec/features/groups/members/manage_groups_spec.rb +++ b/spec/features/groups/members/manage_groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Manage groups', :js do +RSpec.describe 'Groups > Members > Manage groups', :js do include Select2Helper include Spec::Support::Helpers::Features::ListRowsHelpers diff --git a/spec/features/groups/members/manage_members_spec.rb b/spec/features/groups/members/manage_members_spec.rb index e4ba3022d8b..e29d8fd651e 100644 --- a/spec/features/groups/members/manage_members_spec.rb +++ b/spec/features/groups/members/manage_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Manage members' do +RSpec.describe 'Groups > Members > Manage members' do include Select2Helper include Spec::Support::Helpers::Features::ListRowsHelpers diff --git a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb index 491937ce4ab..f80925186ed 100644 --- a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Owner adds member with expiration date', :js do +RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js do include Select2Helper include ActiveSupport::Testing::TimeHelpers diff --git a/spec/features/groups/members/master_manages_access_requests_spec.rb b/spec/features/groups/members/master_manages_access_requests_spec.rb index 1c13bd3d59e..2a17e7d2a5c 100644 --- a/spec/features/groups/members/master_manages_access_requests_spec.rb +++ b/spec/features/groups/members/master_manages_access_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Maintainer manages access requests' do +RSpec.describe 'Groups > Members > Maintainer manages access requests' do it_behaves_like 'Maintainer manages access requests' do let(:entity) { create(:group, :public) } let(:members_page_path) { group_group_members_path(entity) } diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb index 5f22af3529c..307cb63ec8e 100644 --- a/spec/features/groups/members/request_access_spec.rb +++ b/spec/features/groups/members/request_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Request access' do +RSpec.describe 'Groups > Members > Request access' do let(:user) { create(:user) } let(:owner) { create(:user) } let(:group) { create(:group, :public) } diff --git a/spec/features/groups/members/search_members_spec.rb b/spec/features/groups/members/search_members_spec.rb index fda129ce422..4c34ccf87c3 100644 --- a/spec/features/groups/members/search_members_spec.rb +++ b/spec/features/groups/members/search_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Search group member' do +RSpec.describe 'Search group member' do let(:user) { create :user } let(:member) { create :user } diff --git a/spec/features/groups/members/sort_members_spec.rb b/spec/features/groups/members/sort_members_spec.rb index 76709199942..cfc0e421aeb 100644 --- a/spec/features/groups/members/sort_members_spec.rb +++ b/spec/features/groups/members/sort_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > Members > Sort members' do +RSpec.describe 'Groups > Members > Sort members' do let(:owner) { create(:user, name: 'John Doe') } let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) } let(:group) { create(:group) } diff --git a/spec/features/groups/merge_requests_spec.rb b/spec/features/groups/merge_requests_spec.rb index f87fa10e2f4..43d4b6b23e0 100644 --- a/spec/features/groups/merge_requests_spec.rb +++ b/spec/features/groups/merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group merge requests page' do +RSpec.describe 'Group merge requests page' do include FilteredSearchHelpers let(:path) { merge_requests_group_path(group) } diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index 65ef0af5be3..2217bd9d6b5 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group milestones' do +RSpec.describe 'Group milestones' do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project_empty_repo, group: group) } let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group ).user } @@ -102,11 +102,9 @@ describe 'Group milestones' do expect(find('.top-area .all .badge').text).to eq("6") end - it 'lists legacy group milestones and group milestones' do - legacy_milestone = GroupMilestone.build_collection(group, group.projects, { state: 'active' }).first - + it 'lists group and project milestones' do expect(page).to have_selector("#milestone_#{active_group_milestone.id}", count: 1) - expect(page).to have_selector("#milestone_#{legacy_milestone.milestone.id}", count: 1) + expect(page).to have_selector("#milestone_#{active_project_milestone2.id}", count: 1) end it 'shows milestone detail and supports its edit' do @@ -126,74 +124,34 @@ describe 'Group milestones' do expect(page).to have_content('v1.1') expect(page).to have_content('GL-113') expect(page).to have_link( + 'v1.0', + href: project_milestone_path(project, active_project_milestone1) + ) + expect(page).to have_link( '1 Issue', - href: issues_group_path(group, milestone_title: 'v1.0') + href: project_issues_path(project, milestone_title: 'v1.0') ) expect(page).to have_link( '0 Merge Requests', - href: merge_requests_group_path(group, milestone_title: 'v1.0') + href: project_merge_requests_path(project, milestone_title: 'v1.0') + ) + expect(page).to have_link( + 'GL-113', + href: group_milestone_path(group, active_group_milestone) + ) + expect(page).to have_link( + '0 Issues', + href: issues_group_path(group, milestone_title: 'GL-113') + ) + expect(page).to have_link( + '0 Merge Requests', + href: merge_requests_group_path(group, milestone_title: 'GL-113') ) - end - - it 'renders group milestone details' do - click_link 'v1.0' - - expect(page).to have_content('expires on Aug 20, 2114') - expect(page).to have_content('v1.0') - expect(page).to have_content('Issues 1 Open: 1 Closed: 0') - expect(page).to have_link(issue.title, href: project_issue_path(issue.project, issue)) end end end describe 'milestone tabs', :js do - context 'for a legacy group milestone' do - let_it_be(:milestone) { create(:milestone, project: project) } - let_it_be(:label) { create(:label, project: project) } - let_it_be(:issue) { create(:labeled_issue, project: project, milestone: milestone, labels: [label], assignees: [create(:user)]) } - let_it_be(:mr) { create(:merge_request, source_project: project, milestone: milestone) } - - before do - visit group_milestone_path(group, milestone.title, title: milestone.title) - end - - it 'renders the issues tab' do - within('#tab-issues') do - expect(page).to have_content issue.title - end - end - - it 'renders the merge requests tab' do - within('.js-milestone-tabs') do - click_link('Merge Requests') - end - - within('#tab-merge-requests') do - expect(page).to have_content mr.title - end - end - - it 'renders the participants tab' do - within('.js-milestone-tabs') do - click_link('Participants') - end - - within('#tab-participants') do - expect(page).to have_content issue.assignees.first.name - end - end - - it 'renders the labels tab' do - within('.js-milestone-tabs') do - click_link('Labels') - end - - within('#tab-labels') do - expect(page).to have_content label.title - end - end - end - context 'for a group milestone' do let_it_be(:other_project) { create(:project_empty_repo, group: group) } let_it_be(:milestone) { create(:milestone, group: group) } diff --git a/spec/features/groups/milestones_sorting_spec.rb b/spec/features/groups/milestones_sorting_spec.rb index d27511be0b0..a06e64fdee0 100644 --- a/spec/features/groups/milestones_sorting_spec.rb +++ b/spec/features/groups/milestones_sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Milestones sorting', :js do +RSpec.describe 'Milestones sorting', :js do let(:group) { create(:group) } let!(:project) { create(:project_empty_repo, group: group) } let!(:other_project) { create(:project_empty_repo, group: group) } @@ -24,21 +24,12 @@ describe 'Milestones sorting', :js do # assert default sorting within '.milestones' do - expect(page.all('ul.content-list > li').first.text).to include('v2.0') - expect(page.all('ul.content-list > li')[1].text).to include('v3.0') - expect(page.all('ul.content-list > li').last.text).to include('v1.0') + expect(page.all('ul.content-list > li strong > a').map(&:text)).to eq(['v2.0', 'v2.0', 'v3.0', 'v1.0', 'v1.0']) end click_button 'Due soon' - sort_options = find('ul.dropdown-menu-sort li').all('a').collect(&:text) - - expect(sort_options[0]).to eq('Due soon') - expect(sort_options[1]).to eq('Due later') - expect(sort_options[2]).to eq('Start soon') - expect(sort_options[3]).to eq('Start later') - expect(sort_options[4]).to eq('Name, ascending') - expect(sort_options[5]).to eq('Name, descending') + expect(find('ul.dropdown-menu-sort li').all('a').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending']) click_link 'Due later' @@ -46,9 +37,7 @@ describe 'Milestones sorting', :js do # assert descending sorting within '.milestones' do - expect(page.all('ul.content-list > li').first.text).to include('v1.0') - expect(page.all('ul.content-list > li')[1].text).to include('v3.0') - expect(page.all('ul.content-list > li').last.text).to include('v2.0') + expect(page.all('ul.content-list > li strong > a').map(&:text)).to eq(['v1.0', 'v1.0', 'v3.0', 'v2.0', 'v2.0']) end end end diff --git a/spec/features/groups/navbar_spec.rb b/spec/features/groups/navbar_spec.rb index fd5b4ec9345..cfa1f3338a1 100644 --- a/spec/features/groups/navbar_spec.rb +++ b/spec/features/groups/navbar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group navbar' do +RSpec.describe 'Group navbar' do include NavbarStructureHelper include_context 'group navbar structure' @@ -46,6 +46,7 @@ describe 'Group navbar' do before do stub_feature_flags(group_push_rules: false) + stub_feature_flags(group_iterations: false) group.add_maintainer(user) sign_in(user) end diff --git a/spec/features/groups/settings/ci_cd_spec.rb b/spec/features/groups/settings/ci_cd_spec.rb index 5b1a9512c55..9c2f9512b9d 100644 --- a/spec/features/groups/settings/ci_cd_spec.rb +++ b/spec/features/groups/settings/ci_cd_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group CI/CD settings' do +RSpec.describe 'Group CI/CD settings' do include WaitForRequests let(:user) { create(:user) } diff --git a/spec/features/groups/settings/group_badges_spec.rb b/spec/features/groups/settings/group_badges_spec.rb index 72e74df368b..5bf736cc7ce 100644 --- a/spec/features/groups/settings/group_badges_spec.rb +++ b/spec/features/groups/settings/group_badges_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Badges' do +RSpec.describe 'Group Badges' do include WaitForRequests let(:user) { create(:user) } diff --git a/spec/features/groups/settings/repository_spec.rb b/spec/features/groups/settings/repository_spec.rb index 722fd98ce59..d20303027e5 100644 --- a/spec/features/groups/settings/repository_spec.rb +++ b/spec/features/groups/settings/repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Repository settings' do +RSpec.describe 'Group Repository settings' do include WaitForRequests let(:user) { create(:user) } diff --git a/spec/features/groups/share_lock_spec.rb b/spec/features/groups/share_lock_spec.rb index 777f5d98720..d8207899e24 100644 --- a/spec/features/groups/share_lock_spec.rb +++ b/spec/features/groups/share_lock_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group share with group lock' do +RSpec.describe 'Group share with group lock' do let(:root_owner) { create(:user) } let(:root_group) { create(:group) } diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb index bcaed2a5f18..ec30f34199d 100644 --- a/spec/features/groups/show_spec.rb +++ b/spec/features/groups/show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group show page' do +RSpec.describe 'Group show page' do let(:group) { create(:group) } let(:path) { group_path(group) } diff --git a/spec/features/groups/user_browse_projects_group_page_spec.rb b/spec/features/groups/user_browse_projects_group_page_spec.rb index 68221e3fefe..999449a94b0 100644 --- a/spec/features/groups/user_browse_projects_group_page_spec.rb +++ b/spec/features/groups/user_browse_projects_group_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User browse group projects page' do +RSpec.describe 'User browse group projects page' do let(:user) { create :user } let(:group) { create :group } diff --git a/spec/features/groups/user_sees_package_sidebar_spec.rb b/spec/features/groups/user_sees_package_sidebar_spec.rb index f85b6841636..ee216488232 100644 --- a/spec/features/groups/user_sees_package_sidebar_spec.rb +++ b/spec/features/groups/user_sees_package_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > sidebar' do +RSpec.describe 'Groups > sidebar' do let(:user) { create(:user) } let(:group) { create(:group) } diff --git a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb index 742021ae4a1..9fe11070187 100644 --- a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb +++ b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Groups > User sees users dropdowns in issuables list' do +RSpec.describe 'Groups > User sees users dropdowns in issuables list' do let(:entity) { create(:group) } let(:user_in_dropdown) { create(:user) } let!(:user_not_in_dropdown) { create(:user) } diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index c1cb0b4951e..78a35fe1d3f 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group' do +RSpec.describe 'Group' do let(:user) { create(:admin) } before do diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index 1ba3849fe2c..1f8397e45f7 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Help Pages' do +RSpec.describe 'Help Pages' do describe 'Get the main help page' do before do allow(File).to receive(:read).and_call_original diff --git a/spec/features/ics/dashboard_issues_spec.rb b/spec/features/ics/dashboard_issues_spec.rb index bde5488f375..4a93a4b490a 100644 --- a/spec/features/ics/dashboard_issues_spec.rb +++ b/spec/features/ics/dashboard_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dashboard Issues Calendar Feed' do +RSpec.describe 'Dashboard Issues Calendar Feed' do describe 'GET /issues' do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } diff --git a/spec/features/ics/group_issues_spec.rb b/spec/features/ics/group_issues_spec.rb index 0b317095678..05caca4b5a8 100644 --- a/spec/features/ics/group_issues_spec.rb +++ b/spec/features/ics/group_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group Issues Calendar Feed' do +RSpec.describe 'Group Issues Calendar Feed' do describe 'GET /issues' do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } diff --git a/spec/features/ics/project_issues_spec.rb b/spec/features/ics/project_issues_spec.rb index 3c940149670..58a1a32eac2 100644 --- a/spec/features/ics/project_issues_spec.rb +++ b/spec/features/ics/project_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Issues Calendar Feed' do +RSpec.describe 'Project Issues Calendar Feed' do describe 'GET /issues' do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } diff --git a/spec/features/ide/clientside_preview_csp_spec.rb b/spec/features/ide/clientside_preview_csp_spec.rb index e097513def3..eadcb9cd008 100644 --- a/spec/features/ide/clientside_preview_csp_spec.rb +++ b/spec/features/ide/clientside_preview_csp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'IDE Clientside Preview CSP' do +RSpec.describe 'IDE Clientside Preview CSP' do let_it_be(:user) { create(:user) } shared_context 'disable feature' do diff --git a/spec/features/ide/static_object_external_storage_csp_spec.rb b/spec/features/ide/static_object_external_storage_csp_spec.rb index 739b3fe2471..24d37f25739 100644 --- a/spec/features/ide/static_object_external_storage_csp_spec.rb +++ b/spec/features/ide/static_object_external_storage_csp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Static Object External Storage Content Security Policy' do +RSpec.describe 'Static Object External Storage Content Security Policy' do let_it_be(:user) { create(:user) } shared_context 'disable feature' do diff --git a/spec/features/ide/user_commits_changes_spec.rb b/spec/features/ide/user_commits_changes_spec.rb index 56f2c6b8afc..1b1e71e2862 100644 --- a/spec/features/ide/user_commits_changes_spec.rb +++ b/spec/features/ide/user_commits_changes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'IDE user commits changes', :js do +RSpec.describe 'IDE user commits changes', :js do include WebIdeSpecHelpers let(:project) { create(:project, :public, :repository) } @@ -30,14 +30,4 @@ describe 'IDE user commits changes', :js do expect(project.repository.blob_at('master', 'foo/bar/.gitkeep')).to be_nil expect(project.repository.blob_at('master', 'foo/bar/lorem_ipsum.md').data).to eql(content) end - - it 'user adds then deletes new file' do - ide_create_new_file('foo/bar/lorem_ipsum.md') - - expect(page).to have_selector(ide_commit_tab_selector) - - ide_delete_file('foo/bar/lorem_ipsum.md') - - expect(page).not_to have_selector(ide_commit_tab_selector) - end end diff --git a/spec/features/ide/user_opens_merge_request_spec.rb b/spec/features/ide/user_opens_merge_request_spec.rb index 03318287db9..e6101e90a83 100644 --- a/spec/features/ide/user_opens_merge_request_spec.rb +++ b/spec/features/ide/user_opens_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'IDE merge request', :js do +RSpec.describe 'IDE merge request', :js do let(:merge_request) { create(:merge_request, :with_diffs, :simple, source_project: project) } let(:project) { create(:project, :public, :repository) } let(:user) { project.owner } diff --git a/spec/features/ide_spec.rb b/spec/features/ide_spec.rb index 73f6180d944..2505ab0afee 100644 --- a/spec/features/ide_spec.rb +++ b/spec/features/ide_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'IDE', :js do +RSpec.describe 'IDE', :js do describe 'sub-groups' do let(:user) { create(:user) } let(:group) { create(:group) } diff --git a/spec/features/import/manifest_import_spec.rb b/spec/features/import/manifest_import_spec.rb index 36478128dd1..1efbc5642d4 100644 --- a/spec/features/import/manifest_import_spec.rb +++ b/spec/features/import/manifest_import_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Import multiple repositories by uploading a manifest file', :js do +RSpec.describe 'Import multiple repositories by uploading a manifest file', :js do include Select2Helper let(:user) { create(:admin) } diff --git a/spec/features/instance_statistics/cohorts_spec.rb b/spec/features/instance_statistics/cohorts_spec.rb index 0bb2e4b997d..1f112e1831c 100644 --- a/spec/features/instance_statistics/cohorts_spec.rb +++ b/spec/features/instance_statistics/cohorts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Cohorts page' do +RSpec.describe 'Cohorts page' do before do sign_in(create(:admin)) diff --git a/spec/features/instance_statistics/dev_ops_score_spec.rb b/spec/features/instance_statistics/dev_ops_score_spec.rb index 453b5582f48..da87aedab5c 100644 --- a/spec/features/instance_statistics/dev_ops_score_spec.rb +++ b/spec/features/instance_statistics/dev_ops_score_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'DevOps Score' do +RSpec.describe 'DevOps Score' do before do sign_in(create(:admin)) end diff --git a/spec/features/instance_statistics/instance_statistics_spec.rb b/spec/features/instance_statistics/instance_statistics_spec.rb index 0fb78c6eef8..7695bf7874b 100644 --- a/spec/features/instance_statistics/instance_statistics_spec.rb +++ b/spec/features/instance_statistics/instance_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Cohorts page', :js do +RSpec.describe 'Cohorts page', :js do before do sign_in(create(:admin)) end diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index 9cd01894575..f85b4b78e35 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Invites' do +RSpec.describe 'Invites' do let(:user) { create(:user) } let(:owner) { create(:user, name: 'John Doe') } let(:group) { create(:group, name: 'Owned') } diff --git a/spec/features/issuables/close_reopen_report_toggle_spec.rb b/spec/features/issuables/close_reopen_report_toggle_spec.rb index 8805018902f..cf3028ec4c9 100644 --- a/spec/features/issuables/close_reopen_report_toggle_spec.rb +++ b/spec/features/issuables/close_reopen_report_toggle_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issuables Close/Reopen/Report toggle' do +RSpec.describe 'Issuables Close/Reopen/Report toggle' do let(:user) { create(:user) } shared_examples 'an issuable close/reopen/report toggle' do diff --git a/spec/features/issuables/discussion_lock_spec.rb b/spec/features/issuables/discussion_lock_spec.rb index 0cd2c077081..13f1742fbf6 100644 --- a/spec/features/issuables/discussion_lock_spec.rb +++ b/spec/features/issuables/discussion_lock_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Discussion Lock', :js do +RSpec.describe 'Discussion Lock', :js do let(:user) { create(:user) } let(:issue) { create(:issue, project: project, author: user) } let(:project) { create(:project, :public) } diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index 7014a51ccdc..382a7a9321c 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'issuable list' do +RSpec.describe 'issuable list' do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/issuables/markdown_references/internal_references_spec.rb b/spec/features/issuables/markdown_references/internal_references_spec.rb index efd84cf67b0..aceaea8d2ed 100644 --- a/spec/features/issuables/markdown_references/internal_references_spec.rb +++ b/spec/features/issuables/markdown_references/internal_references_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Internal references", :js do +RSpec.describe "Internal references", :js do include Spec::Support::Helpers::Features::NotesHelpers let(:private_project_user) { private_project.owner } diff --git a/spec/features/issuables/markdown_references/jira_spec.rb b/spec/features/issuables/markdown_references/jira_spec.rb index 779606effdc..a3a259e21a1 100644 --- a/spec/features/issuables/markdown_references/jira_spec.rb +++ b/spec/features/issuables/markdown_references/jira_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Jira", :js do +RSpec.describe "Jira", :js do let(:user) { create(:user) } let(:actual_project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, target_project: actual_project, source_project: actual_project) } diff --git a/spec/features/issuables/shortcuts_issuable_spec.rb b/spec/features/issuables/shortcuts_issuable_spec.rb index da8a0dd7b0f..78cd8d0bef3 100644 --- a/spec/features/issuables/shortcuts_issuable_spec.rb +++ b/spec/features/issuables/shortcuts_issuable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Blob shortcuts', :js do +RSpec.describe 'Blob shortcuts', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } let(:issue) { create(:issue, project: project, author: user) } diff --git a/spec/features/issuables/sorting_list_spec.rb b/spec/features/issuables/sorting_list_spec.rb index b7813c8ba30..59518723740 100644 --- a/spec/features/issuables/sorting_list_spec.rb +++ b/spec/features/issuables/sorting_list_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe 'Sort Issuable List' do +RSpec.describe 'Sort Issuable List' do let(:project) { create(:project, :public) } let(:first_created_issuable) { issuables.order_created_asc.first } diff --git a/spec/features/issuables/user_sees_sidebar_spec.rb b/spec/features/issuables/user_sees_sidebar_spec.rb index 52040eb8cbb..04bf704b6a4 100644 --- a/spec/features/issuables/user_sees_sidebar_spec.rb +++ b/spec/features/issuables/user_sees_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Sidebar on Mobile' do +RSpec.describe 'Issue Sidebar on Mobile' do include MobileHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/issues/bulk_assignment_labels_spec.rb b/spec/features/issues/bulk_assignment_labels_spec.rb index fc9176715c3..84a786e91a7 100644 --- a/spec/features/issues/bulk_assignment_labels_spec.rb +++ b/spec/features/issues/bulk_assignment_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > Labels bulk assignment' do +RSpec.describe 'Issues > Labels bulk assignment' do let(:user) { create(:user) } let!(:project) { create(:project) } let!(:issue1) { create(:issue, project: project, title: "Issue 1") } @@ -302,7 +302,23 @@ describe 'Issues > Labels bulk assignment' do sleep 1 # needed expect(find("#issue_#{issue1.id}")).to have_content 'bug' - expect(find("#issue_#{issue1.id}")).not_to have_content 'feature' + expect(find("#issue_#{issue1.id}")).to have_content 'feature' + end + end + + context 'mark previously toggled label' do + before do + enable_bulk_update + end + + it do + open_labels_dropdown ['feature'] + + check_issue issue1 + + update_issues + + expect(find("#issue_#{issue1.id}")).to have_content 'feature' end end diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index a3742af31de..6fc648954b4 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Resolving all open threads in a merge request from an issue', :js do +RSpec.describe 'Resolving all open threads in a merge request from an issue', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb index 1c17b39c03a..55a02dc4255 100644 --- a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Resolve an open thread in a merge request by creating an issue', :js do +RSpec.describe 'Resolve an open thread in a merge request by creating an issue', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/issues/csv_spec.rb b/spec/features/issues/csv_spec.rb index 193c83d2a40..8d06bf24f8b 100644 --- a/spec/features/issues/csv_spec.rb +++ b/spec/features/issues/csv_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues csv' do +RSpec.describe 'Issues csv' do let(:user) { create(:user) } let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, title: 'v1.0', project: project) } diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb index c207e91f02e..381633b0fc9 100644 --- a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown assignee', :js do +RSpec.describe 'Dropdown assignee', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb index 8ded11b3b08..91c85825a17 100644 --- a/spec/features/issues/filtered_search/dropdown_author_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_author_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown author', :js do +RSpec.describe 'Dropdown author', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/dropdown_base_spec.rb b/spec/features/issues/filtered_search/dropdown_base_spec.rb index 14d3f48b8fc..d730525cb8b 100644 --- a/spec/features/issues/filtered_search/dropdown_base_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown base', :js do +RSpec.describe 'Dropdown base', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/dropdown_emoji_spec.rb b/spec/features/issues/filtered_search/dropdown_emoji_spec.rb index 9ab0f49cd15..c2c933f8a86 100644 --- a/spec/features/issues/filtered_search/dropdown_emoji_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_emoji_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown emoji', :js do +RSpec.describe 'Dropdown emoji', :js do include FilteredSearchHelpers let!(:project) { create(:project, :public) } diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index 10b092c6957..9edc6e0b593 100644 --- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown hint', :js do +RSpec.describe 'Dropdown hint', :js do include FilteredSearchHelpers let!(:project) { create(:project, :public) } diff --git a/spec/features/issues/filtered_search/dropdown_label_spec.rb b/spec/features/issues/filtered_search/dropdown_label_spec.rb index a982053dbcb..c0d5fe0d860 100644 --- a/spec/features/issues/filtered_search/dropdown_label_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown label', :js do +RSpec.describe 'Dropdown label', :js do include FilteredSearchHelpers let(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb index 56beb35a1c5..68afd973f1d 100644 --- a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown milestone', :js do +RSpec.describe 'Dropdown milestone', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/dropdown_release_spec.rb b/spec/features/issues/filtered_search/dropdown_release_spec.rb index ae1c84d71b4..daf686c2850 100644 --- a/spec/features/issues/filtered_search/dropdown_release_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Dropdown release', :js do +RSpec.describe 'Dropdown release', :js do include FilteredSearchHelpers let!(:project) { create(:project, :repository) } diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb index 3ee5840e1b9..5b5348d4069 100644 --- a/spec/features/issues/filtered_search/filter_issues_spec.rb +++ b/spec/features/issues/filtered_search/filter_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Filter issues', :js do +RSpec.describe 'Filter issues', :js do include FilteredSearchHelpers let(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/recent_searches_spec.rb b/spec/features/issues/filtered_search/recent_searches_spec.rb index e05c7aa3af5..85b7a093536 100644 --- a/spec/features/issues/filtered_search/recent_searches_spec.rb +++ b/spec/features/issues/filtered_search/recent_searches_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Recent searches', :js do +RSpec.describe 'Recent searches', :js do include FilteredSearchHelpers let(:project_1) { create(:project, :public) } diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index ad994270218..167fecc5ab1 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Search bar', :js do +RSpec.describe 'Search bar', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index d34253b3c5e..59588978a8e 100644 --- a/spec/features/issues/filtered_search/visual_tokens_spec.rb +++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Visual tokens', :js do +RSpec.describe 'Visual tokens', :js do include FilteredSearchHelpers let!(:project) { create(:project) } diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 8d7b6be5ea2..dac066856c0 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New/edit issue', :js do +RSpec.describe 'New/edit issue', :js do include ActionView::Helpers::JavaScriptHelper include FormHelper diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 501a2d347d1..4a7e1ba99e9 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'GFM autocomplete', :js do +RSpec.describe 'GFM autocomplete', :js do let(:issue_xss_title) { 'This will execute alert<img src=x onerror=alert(2)<img src=x onerror=alert(1)>' } let(:user_xss_title) { 'eve <img src=x onerror=alert(2)<img src=x onerror=alert(1)>' } let(:label_xss_title) { 'alert label <img src=x onerror="alert(\'Hello xss\');" a' } diff --git a/spec/features/issues/group_label_sidebar_spec.rb b/spec/features/issues/group_label_sidebar_spec.rb index fe6d95e1039..e6a173f4589 100644 --- a/spec/features/issues/group_label_sidebar_spec.rb +++ b/spec/features/issues/group_label_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Group label on issue' do +RSpec.describe 'Group label on issue' do it 'renders link to the project issues page' do group = create(:group) project = create(:project, :public, namespace: group) diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb index 3bb70fdf376..ab319daec71 100644 --- a/spec/features/issues/issue_detail_spec.rb +++ b/spec/features/issues/issue_detail_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue Detail', :js do +RSpec.describe 'Issue Detail', :js do let(:user) { create(:user) } let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project, author: user) } diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index e7c675bf6bf..9e4362bf0e5 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' -describe 'Issue Sidebar' do +RSpec.describe 'Issue Sidebar' do include MobileHelpers let(:group) { create(:group, :nested) } let(:project) { create(:project, :public, namespace: group) } - let!(:user) { create(:user)} + let!(:user) { create(:user) } let!(:label) { create(:label, project: project, title: 'bug') } let(:issue) { create(:labeled_issue, project: project, labels: [label]) } let!(:xss_label) { create(:label, project: project, title: '<script>alert("xss");</script>') } @@ -20,62 +20,125 @@ describe 'Issue Sidebar' do let(:user2) { create(:user) } let(:issue2) { create(:issue, project: project, author: user2) } - before do - project.add_developer(user) - visit_issue(project, issue2) + context 'when invite_members_version_a experiment is enabled' do + before do + stub_experiment_for_user(invite_members_version_a: true) + end - find('.block.assignee .edit-link').click + context 'when user can not see invite members' do + before do + project.add_developer(user) + visit_issue(project, issue2) - wait_for_requests - end + find('.block.assignee .edit-link').click - it 'shows author in assignee dropdown' do - page.within '.dropdown-menu-user' do - expect(page).to have_content(user2.name) + wait_for_requests + end + + it 'does not see link to invite members' do + page.within '.dropdown-menu-user' do + expect(page).not_to have_link('Invite Members') + end + end end - end - it 'shows author when filtering assignee dropdown' do - page.within '.dropdown-menu-user' do - find('.dropdown-input-field').native.send_keys user2.name - sleep 1 # Required to wait for end of input delay + context 'when user can see invite members' do + before do + project.add_maintainer(user) + visit_issue(project, issue2) + + find('.block.assignee .edit-link').click - wait_for_requests + wait_for_requests + end - expect(page).to have_content(user2.name) + it 'sees link to invite members' do + page.within '.dropdown-menu-user' do + expect(page).to have_link('Invite Members', href: project_project_members_path(project)) + expect(page).to have_selector('[data-track-event="click_invite_members"]') + expect(page).to have_selector("[data-track-label='edit_assignee']") + end + end end end - it 'assigns yourself' do - find('.block.assignee .dropdown-menu-toggle').click + context 'when invite_members_version_a experiment is not enabled' do + context 'when user is a developer' do + before do + project.add_developer(user) + visit_issue(project, issue2) - click_button 'assign yourself' + find('.block.assignee .edit-link').click - wait_for_requests + wait_for_requests + end - find('.block.assignee .edit-link').click + it 'shows author in assignee dropdown' do + page.within '.dropdown-menu-user' do + expect(page).to have_content(user2.name) + end + end - page.within '.dropdown-menu-user' do - expect(page.find('.dropdown-header')).to be_visible - expect(page.find('.dropdown-menu-user-link.is-active')).to have_content(user.name) - end - end + it 'shows author when filtering assignee dropdown' do + page.within '.dropdown-menu-user' do + find('.dropdown-input-field').native.send_keys user2.name + sleep 1 # Required to wait for end of input delay - it 'keeps your filtered term after filtering and dismissing the dropdown' do - find('.dropdown-input-field').native.send_keys user2.name + wait_for_requests - wait_for_requests + expect(page).to have_content(user2.name) + end + end + + it 'assigns yourself' do + find('.block.assignee .dropdown-menu-toggle').click + + click_button 'assign yourself' + + wait_for_requests + + find('.block.assignee .edit-link').click + + page.within '.dropdown-menu-user' do + expect(page.find('.dropdown-header')).to be_visible + expect(page.find('.dropdown-menu-user-link.is-active')).to have_content(user.name) + end + end + + it 'keeps your filtered term after filtering and dismissing the dropdown' do + find('.dropdown-input-field').native.send_keys user2.name + + wait_for_requests - page.within '.dropdown-menu-user' do - expect(page).not_to have_content 'Unassigned' - click_link user2.name + page.within '.dropdown-menu-user' do + expect(page).not_to have_content 'Unassigned' + click_link user2.name + end + + find('.js-right-sidebar').click + find('.block.assignee .edit-link').click + + expect(page.all('.dropdown-menu-user li').length).to eq(1) + expect(find('.dropdown-input-field').value).to eq(user2.name) + end end - find('.js-right-sidebar').click - find('.block.assignee .edit-link').click + context 'when user is a maintainer' do + before do + project.add_maintainer(user) + visit_issue(project, issue2) + + find('.block.assignee .edit-link').click - expect(page.all('.dropdown-menu-user li').length).to eq(1) - expect(find('.dropdown-input-field').value).to eq(user2.name) + wait_for_requests + end + + it 'shows author in assignee dropdown and no invite link' do + page.within '.dropdown-menu-user' do + expect(page).not_to have_link('Invite Members') + end + end + end end end diff --git a/spec/features/issues/keyboard_shortcut_spec.rb b/spec/features/issues/keyboard_shortcut_spec.rb index c5d53cd1cd0..ab40f124257 100644 --- a/spec/features/issues/keyboard_shortcut_spec.rb +++ b/spec/features/issues/keyboard_shortcut_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues shortcut', :js do +RSpec.describe 'Issues shortcut', :js do context 'New Issue shortcut' do context 'issues are enabled' do let(:project) { create(:project) } diff --git a/spec/features/issues/markdown_toolbar_spec.rb b/spec/features/issues/markdown_toolbar_spec.rb index d174fdcb25e..aab9d1026f9 100644 --- a/spec/features/issues/markdown_toolbar_spec.rb +++ b/spec/features/issues/markdown_toolbar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue markdown toolbar', :js do +RSpec.describe 'Issue markdown toolbar', :js do let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index 831bcf8931e..f3a6655f397 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'issue move to another project' do +RSpec.describe 'issue move to another project' do let(:user) { create(:user) } let(:old_project) { create(:project, :repository) } let(:text) { 'Some issue description' } diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb index 04ad012d57e..bc4c67fdd79 100644 --- a/spec/features/issues/note_polling_spec.rb +++ b/spec/features/issues/note_polling_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue notes polling', :js do +RSpec.describe 'Issue notes polling', :js do include NoteInteractionHelpers let(:project) { create(:project, :public) } diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index 74eb699c7ef..be85d73d777 100644 --- a/spec/features/issues/notes_on_issues_spec.rb +++ b/spec/features/issues/notes_on_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Create notes on issues', :js do +RSpec.describe 'Create notes on issues', :js do let(:user) { create(:user) } def submit_comment(text) diff --git a/spec/features/issues/resource_label_events_spec.rb b/spec/features/issues/resource_label_events_spec.rb index b367bbe2c99..f2c978c525e 100644 --- a/spec/features/issues/resource_label_events_spec.rb +++ b/spec/features/issues/resource_label_events_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'List issue resource label events', :js do +RSpec.describe 'List issue resource label events', :js do let(:user) { create(:user) } let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project, author: user) } diff --git a/spec/features/issues/rss_spec.rb b/spec/features/issues/rss_spec.rb index 7577df3bc7d..6c4498ea711 100644 --- a/spec/features/issues/rss_spec.rb +++ b/spec/features/issues/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Issues RSS' do +RSpec.describe 'Project Issues RSS' do let!(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } diff --git a/spec/features/issues/spam_issues_spec.rb b/spec/features/issues/spam_issues_spec.rb index 47e7022011d..aec806c566d 100644 --- a/spec/features/issues/spam_issues_spec.rb +++ b/spec/features/issues/spam_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New issue', :js do +RSpec.describe 'New issue', :js do include StubENV let(:project) { create(:project, :public) } @@ -81,7 +81,7 @@ describe 'New issue', :js do before do allow_next_instance_of(Spam::SpamVerdictService) do |verdict_service| - allow(verdict_service).to receive(:execute).and_return(REQUIRE_RECAPTCHA) + allow(verdict_service).to receive(:execute).and_return(CONDITIONAL_ALLOW) end visit new_project_issue_path(project) @@ -164,6 +164,8 @@ describe 'New issue', :js do end context 'when the SpamVerdictService allows' do + include_context 'includes Spam constants' + before do allow_next_instance_of(Spam::SpamVerdictService) do |verdict_service| allow(verdict_service).to receive(:execute).and_return(ALLOW) diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb index 4bb96ad069c..3de33049db0 100644 --- a/spec/features/issues/todo_spec.rb +++ b/spec/features/issues/todo_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Manually create a todo item from issue', :js do +RSpec.describe 'Manually create a todo item from issue', :js do let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let!(:user) { create(:user)} diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index 98f70df1c8b..f8385f183d2 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multiple issue updating from issues#index', :js do +RSpec.describe 'Multiple issue updating from issues#index', :js do let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let!(:user) { create(:user)} diff --git a/spec/features/issues/user_comments_on_issue_spec.rb b/spec/features/issues/user_comments_on_issue_spec.rb index 363906b017a..005d45d9c92 100644 --- a/spec/features/issues/user_comments_on_issue_spec.rb +++ b/spec/features/issues/user_comments_on_issue_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User comments on issue", :js do +RSpec.describe "User comments on issue", :js do include Spec::Support::Helpers::Features::NotesHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb index 848dbbb85a6..a546fb3e85b 100644 --- a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb +++ b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User creates branch and merge request on issue page', :js do +RSpec.describe 'User creates branch and merge request on issue page', :js do let(:membership_level) { :developer } let(:user) { create(:user) } let!(:project) { create(:project, :repository, :public) } diff --git a/spec/features/issues/user_creates_confidential_merge_request_spec.rb b/spec/features/issues/user_creates_confidential_merge_request_spec.rb index 84f358061e6..ea96165d7b7 100644 --- a/spec/features/issues/user_creates_confidential_merge_request_spec.rb +++ b/spec/features/issues/user_creates_confidential_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User creates confidential merge request on issue page', :js do +RSpec.describe 'User creates confidential merge request on issue page', :js do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/issues/user_creates_issue_by_email_spec.rb b/spec/features/issues/user_creates_issue_by_email_spec.rb index c73a65849cc..5a0036170ab 100644 --- a/spec/features/issues/user_creates_issue_by_email_spec.rb +++ b/spec/features/issues/user_creates_issue_by_email_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > User creates issue by email' do +RSpec.describe 'Issues > User creates issue by email' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public) } diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index efcaa8247df..a2c868d0256 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User creates issue" do +RSpec.describe "User creates issue" do include DropzoneHelper let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb index d50cf16d8ef..39bf535c715 100644 --- a/spec/features/issues/user_edits_issue_spec.rb +++ b/spec/features/issues/user_edits_issue_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "Issues > User edits issue", :js do +RSpec.describe "Issues > User edits issue", :js do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } let_it_be(:issue) { create(:issue, project: project, author: user, assignees: [user]) } diff --git a/spec/features/issues/user_filters_issues_spec.rb b/spec/features/issues/user_filters_issues_spec.rb index 9ce47e68926..20ad47b111a 100644 --- a/spec/features/issues/user_filters_issues_spec.rb +++ b/spec/features/issues/user_filters_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User filters issues' do +RSpec.describe 'User filters issues' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index 095ae9f276c..7b7e087a6d6 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User interacts with awards' do +RSpec.describe 'User interacts with awards' do let(:user) { create(:user) } describe 'User interacts with awards in an issue', :js do diff --git a/spec/features/issues/user_resets_their_incoming_email_token_spec.rb b/spec/features/issues/user_resets_their_incoming_email_token_spec.rb index 108b6f550db..a20f65abebf 100644 --- a/spec/features/issues/user_resets_their_incoming_email_token_spec.rb +++ b/spec/features/issues/user_resets_their_incoming_email_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > User resets their incoming email token' do +RSpec.describe 'Issues > User resets their incoming email token' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public, namespace: user.namespace) } let_it_be(:issue) { create(:issue, project: project) } diff --git a/spec/features/issues/user_sees_breadcrumb_links_spec.rb b/spec/features/issues/user_sees_breadcrumb_links_spec.rb index 8a120a0a0b2..2660101c330 100644 --- a/spec/features/issues/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/issues/user_sees_breadcrumb_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New issue breadcrumb' do +RSpec.describe 'New issue breadcrumb' do let_it_be(:project, reload: true) { create(:project) } let(:user) { project.creator } diff --git a/spec/features/issues/user_sees_empty_state_spec.rb b/spec/features/issues/user_sees_empty_state_spec.rb index 114d119aca8..047c5ca2189 100644 --- a/spec/features/issues/user_sees_empty_state_spec.rb +++ b/spec/features/issues/user_sees_empty_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > User sees empty state' do +RSpec.describe 'Issues > User sees empty state' do let_it_be(:project) { create(:project, :public) } let_it_be(:user) { project.creator } diff --git a/spec/features/issues/user_sees_live_update_spec.rb b/spec/features/issues/user_sees_live_update_spec.rb index 98c7d289fb0..c9b751715bc 100644 --- a/spec/features/issues/user_sees_live_update_spec.rb +++ b/spec/features/issues/user_sees_live_update_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > User sees live update', :js do +RSpec.describe 'Issues > User sees live update', :js do let_it_be(:project) { create(:project, :public) } let_it_be(:user) { project.creator } diff --git a/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb b/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb index c3f17227701..7a2b637e48e 100644 --- a/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb +++ b/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issues > Real-time sidebar', :js do +RSpec.describe 'Issues > Real-time sidebar', :js do let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:user) { create(:user) } diff --git a/spec/features/issues/user_sorts_issue_comments_spec.rb b/spec/features/issues/user_sorts_issue_comments_spec.rb index e1c0acc32f1..555f8827374 100644 --- a/spec/features/issues/user_sorts_issue_comments_spec.rb +++ b/spec/features/issues/user_sorts_issue_comments_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Comment sort direction' do +RSpec.describe 'Comment sort direction' do let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:comment_1) { create(:note_on_issue, noteable: issue, project: project, note: 'written first') } diff --git a/spec/features/issues/user_sorts_issues_spec.rb b/spec/features/issues/user_sorts_issues_spec.rb index 66110f55435..ec38bf99035 100644 --- a/spec/features/issues/user_sorts_issues_spec.rb +++ b/spec/features/issues/user_sorts_issues_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User sorts issues" do +RSpec.describe "User sorts issues" do include SortingHelper include IssueHelpers diff --git a/spec/features/issues/user_toggles_subscription_spec.rb b/spec/features/issues/user_toggles_subscription_spec.rb index ba167362511..971c8a3b431 100644 --- a/spec/features/issues/user_toggles_subscription_spec.rb +++ b/spec/features/issues/user_toggles_subscription_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User toggles subscription", :js do +RSpec.describe "User toggles subscription", :js do let(:project) { create(:project_empty_repo, :public) } let(:user) { create(:user) } let(:issue) { create(:issue, project: project, author: user) } diff --git a/spec/features/issues/user_uses_quick_actions_spec.rb b/spec/features/issues/user_uses_quick_actions_spec.rb index 09f07f8c908..c5eb3f415ff 100644 --- a/spec/features/issues/user_uses_quick_actions_spec.rb +++ b/spec/features/issues/user_uses_quick_actions_spec.rb @@ -7,7 +7,7 @@ require 'spec_helper' # for example, adding quick actions when creating the issue and checking DateTime formats on UI. # Because this kind of spec takes more time to run there is no need to add new ones # for each existing quick action unless they test something not tested by existing tests. -describe 'Issues > User uses quick actions', :js do +RSpec.describe 'Issues > User uses quick actions', :js do include Spec::Support::Helpers::Features::NotesHelpers context "issuable common quick actions" do diff --git a/spec/features/issues/user_views_issue_spec.rb b/spec/features/issues/user_views_issue_spec.rb index dd04ac94105..2b610bab9f0 100644 --- a/spec/features/issues/user_views_issue_spec.rb +++ b/spec/features/issues/user_views_issue_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User views issue" do +RSpec.describe "User views issue" do let(:project) { create(:project_empty_repo, :public) } let(:user) { create(:user) } let(:issue) { create(:issue, project: project, description: "# Description header", author: user) } @@ -35,18 +35,38 @@ describe "User views issue" do describe 'user status' do subject { visit(project_issue_path(project, issue)) } - describe 'showing status of the author of the issue' do + context 'when showing status of the author of the issue' do it_behaves_like 'showing user status' do let(:user_with_status) { issue.author } end end - describe 'showing status of a user who commented on an issue', :js do + context 'when showing status of a user who commented on an issue', :js do let!(:note) { create(:note, noteable: issue, project: project, author: user_with_status) } it_behaves_like 'showing user status' do let(:user_with_status) { create(:user) } end end + + context 'when status message has an emoji', :js do + let(:message) { 'My status with an emoji' } + let(:message_emoji) { 'basketball' } + + let!(:note) { create(:note, noteable: issue, project: project, author: user) } + let!(:status) { create(:user_status, user: user, emoji: 'smirk', message: "#{message} :#{message_emoji}:") } + + it 'correctly renders the emoji' do + tooltip_span = page.first(".user-status-emoji[title^='#{message}']") + + tooltip_span.hover + + tooltip = page.find('.tooltip .tooltip-inner') + + page.within(tooltip) do + expect(page).to have_emoji(message_emoji) + end + end + end end end diff --git a/spec/features/issues/user_views_issues_spec.rb b/spec/features/issues/user_views_issues_spec.rb index 796e618c7c8..91de813e414 100644 --- a/spec/features/issues/user_views_issues_spec.rb +++ b/spec/features/issues/user_views_issues_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User views issues" do +RSpec.describe "User views issues" do let!(:closed_issue) { create(:closed_issue, project: project) } let!(:open_issue1) { create(:issue, project: project) } let!(:open_issue2) { create(:issue, project: project) } diff --git a/spec/features/labels_hierarchy_spec.rb b/spec/features/labels_hierarchy_spec.rb index c66d858a019..3ab7fbea198 100644 --- a/spec/features/labels_hierarchy_spec.rb +++ b/spec/features/labels_hierarchy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Labels Hierarchy', :js do +RSpec.describe 'Labels Hierarchy', :js do include FilteredSearchHelpers let!(:user) { create(:user) } diff --git a/spec/features/markdown/copy_as_gfm_spec.rb b/spec/features/markdown/copy_as_gfm_spec.rb index d40c2b8bafd..80dcdd08f74 100644 --- a/spec/features/markdown/copy_as_gfm_spec.rb +++ b/spec/features/markdown/copy_as_gfm_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Copy as GFM', :js do +RSpec.describe 'Copy as GFM', :js do include MarkupHelper include RepoHelpers include ActionView::Helpers::JavaScriptHelper @@ -157,7 +157,7 @@ describe 'Copy as GFM', :js do GFM pipeline: :wiki, - project_wiki: @project.wiki + wiki: @project.wiki ) verify( diff --git a/spec/features/markdown/gitlab_flavored_markdown_spec.rb b/spec/features/markdown/gitlab_flavored_markdown_spec.rb index f34af268630..da4208318eb 100644 --- a/spec/features/markdown/gitlab_flavored_markdown_spec.rb +++ b/spec/features/markdown/gitlab_flavored_markdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "GitLab Flavored Markdown" do +RSpec.describe "GitLab Flavored Markdown" do let(:user) { create(:user) } let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/markdown/markdown_spec.rb b/spec/features/markdown/markdown_spec.rb index 9ebd85acb81..d9d3f566bce 100644 --- a/spec/features/markdown/markdown_spec.rb +++ b/spec/features/markdown/markdown_spec.rb @@ -26,7 +26,7 @@ require 'erb' # # See the MarkdownFeature class for setup details. -describe 'GitLab Markdown', :aggregate_failures do +RSpec.describe 'GitLab Markdown', :aggregate_failures do include Capybara::Node::Matchers include MarkupHelper include MarkdownMatchers @@ -269,15 +269,15 @@ describe 'GitLab Markdown', :aggregate_failures do context 'wiki pipeline' do before do - @project_wiki = @feat.project_wiki - @project_wiki_page = @feat.project_wiki_page + @wiki = @feat.wiki + @wiki_page = @feat.wiki_page path = 'images/example.jpg' gitaly_wiki_file = Gitlab::GitalyClient::WikiFile.new(path: path) - expect(@project_wiki).to receive(:find_file).with(path).and_return(Gitlab::Git::WikiFile.new(gitaly_wiki_file)) - allow(@project_wiki).to receive(:wiki_base_path) { '/namespace1/gitlabhq/wikis' } + expect(@wiki).to receive(:find_file).with(path).and_return(Gitlab::Git::WikiFile.new(gitaly_wiki_file)) + allow(@wiki).to receive(:wiki_base_path) { '/namespace1/gitlabhq/wikis' } - @html = markdown(@feat.raw_markdown, { pipeline: :wiki, project_wiki: @project_wiki, page_slug: @project_wiki_page.slug }) + @html = markdown(@feat.raw_markdown, { pipeline: :wiki, wiki: @wiki, page_slug: @wiki_page.slug }) end it_behaves_like 'all pipelines' diff --git a/spec/features/markdown/math_spec.rb b/spec/features/markdown/math_spec.rb index 76eef66c517..e5fb9131ce0 100644 --- a/spec/features/markdown/math_spec.rb +++ b/spec/features/markdown/math_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Math rendering', :js do +RSpec.describe 'Math rendering', :js do let!(:project) { create(:project, :public) } it 'renders inline and display math correctly' do diff --git a/spec/features/markdown/mermaid_spec.rb b/spec/features/markdown/mermaid_spec.rb index 4bf7edf98ca..256dfdc26e9 100644 --- a/spec/features/markdown/mermaid_spec.rb +++ b/spec/features/markdown/mermaid_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Mermaid rendering', :js do +RSpec.describe 'Mermaid rendering', :js do it 'renders Mermaid diagrams correctly' do description = <<~MERMAID ```mermaid @@ -118,10 +118,7 @@ describe 'Mermaid rendering', :js do visit project_issue_path(project, issue) - svg = page.find('svg.mermaid') - expect(svg[:style]).to match(/max-width/) - expect(svg[:width].to_i).to eq(100) - expect(svg[:height].to_i).to eq(0) + expect(page).to have_css('svg.mermaid[style*="max-width"][width="100%"]') end it 'display button when diagram exceeds length', :js do diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb index 7b0eb8959a5..092408c2be0 100644 --- a/spec/features/markdown/metrics_spec.rb +++ b/spec/features/markdown/metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do +RSpec.describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do include PrometheusHelpers include GrafanaApiHelpers include MetricsDashboardUrlHelpers diff --git a/spec/features/merge_request/batch_comments_spec.rb b/spec/features/merge_request/batch_comments_spec.rb new file mode 100644 index 00000000000..60671213d75 --- /dev/null +++ b/spec/features/merge_request/batch_comments_spec.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Merge request > Batch comments', :js do + include MergeRequestDiffHelpers + include RepoHelpers + + let(:user) { create(:user) } + let(:project) { create(:project, :repository) } + let(:merge_request) do + create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') + end + + before do + project.add_maintainer(user) + + sign_in(user) + end + + context 'Feature is enabled' do + before do + stub_feature_flags(diffs_batch_load: false) + + visit_diffs + end + + it 'has review bar' do + expect(page).to have_css('.review-bar-component', visible: false) + end + + it 'adds draft note' do + write_comment + + expect(find('.draft-note-component')).to have_content('Line is wrong') + + expect(page).to have_css('.review-bar-component') + + expect(find('.review-bar-content .btn-success')).to have_content('1') + end + + it 'publishes review' do + write_comment + + page.within('.review-bar-content') do + click_button 'Finish review' + click_button 'Submit review' + end + + wait_for_requests + + expect(page).not_to have_selector('.draft-note-component', text: 'Line is wrong') + + expect(page).to have_selector('.note:not(.draft-note)', text: 'Line is wrong') + end + + it 'publishes single comment' do + write_comment + + click_button 'Add comment now' + + wait_for_requests + + expect(page).not_to have_selector('.draft-note-component', text: 'Line is wrong') + + expect(page).to have_selector('.note:not(.draft-note)', text: 'Line is wrong') + end + + it 'discards review' do + write_comment + + click_button 'Discard review' + + click_button 'Delete all pending comments' + + wait_for_requests + + expect(page).not_to have_selector('.draft-note-component') + end + + it 'deletes draft note' do + write_comment + + accept_alert { find('.js-note-delete').click } + + wait_for_requests + + expect(page).not_to have_selector('.draft-note-component', text: 'Line is wrong') + end + + it 'edits draft note' do + write_comment + + find('.js-note-edit').click + + # make sure comment form is in view + execute_script("window.scrollBy(0, 200)") + + page.within('.js-discussion-note-form') do + fill_in('note_note', with: 'Testing update') + click_button('Save comment') + end + + wait_for_requests + + expect(page).to have_selector('.draft-note-component', text: 'Testing update') + end + + context 'in parallel diff' do + before do + find('.js-show-diff-settings').click + click_button 'Side-by-side' + end + + it 'adds draft comments to both sides' do + write_parallel_comment('2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9') + + # make sure line 9 is in the view + execute_script("window.scrollBy(0, -200)") + + write_parallel_comment('2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9', button_text: 'Add to review', text: 'Another wrong line') + + expect(find('.new .draft-note-component')).to have_content('Line is wrong') + expect(find('.old .draft-note-component')).to have_content('Another wrong line') + + expect(find('.review-bar-content .btn-success')).to have_content('2') + end + end + + context 'thread is unresolved' do + let!(:active_discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } + + before do + visit_diffs + end + + it 'publishes comment right away and resolves the thread' do + expect(active_discussion.resolved?).to eq(false) + + write_reply_to_discussion(button_text: 'Add comment now', resolve: true) + + page.within '.line-resolve-all-container' do + expect(page).to have_content('All threads resolved') + expect(page).to have_selector('.line-resolve-btn.is-active') + end + end + + it 'publishes review and resolves the thread' do + expect(active_discussion.resolved?).to eq(false) + + write_reply_to_discussion(resolve: true) + + page.within('.review-bar-content') do + click_button 'Finish review' + click_button 'Submit review' + end + + wait_for_requests + + page.within '.line-resolve-all-container' do + expect(page).to have_content('All threads resolved') + expect(page).to have_selector('.line-resolve-btn.is-active') + end + end + end + + context 'thread is resolved' do + let!(:active_discussion) { create(:diff_note_on_merge_request, :resolved, noteable: merge_request, project: project).to_discussion } + + before do + active_discussion.resolve!(@current_user) + + visit_diffs + + page.find('.js-diff-comment-avatar').click + end + + it 'publishes comment right away and unresolves the thread' do + expect(active_discussion.resolved?).to eq(true) + + write_reply_to_discussion(button_text: 'Add comment now', unresolve: true) + + page.within '.line-resolve-all-container' do + expect(page).to have_content('1 unresolved thread') + expect(page).not_to have_selector('.line-resolve-btn.is-active') + end + end + + it 'publishes review and unresolves the thread' do + expect(active_discussion.resolved?).to eq(true) + + wait_for_requests + + write_reply_to_discussion(button_text: 'Start a review', unresolve: true) + + page.within('.review-bar-content') do + click_button 'Finish review' + click_button 'Submit review' + end + + wait_for_requests + + page.within '.line-resolve-all-container' do + expect(page).to have_content('1 unresolved thread') + expect(page).not_to have_selector('.line-resolve-btn.is-active') + end + end + end + end + + def visit_diffs + visit diffs_project_merge_request_path(merge_request.project, merge_request) + + wait_for_requests + end + + def write_comment(button_text: 'Start a review', text: 'Line is wrong') + click_diff_line(find("[id='#{sample_compare.changes[0][:line_code]}']")) + + page.within('.js-discussion-note-form') do + fill_in('note_note', with: text) + click_button(button_text) + end + + wait_for_requests + end + + def write_parallel_comment(line, button_text: 'Start a review', text: 'Line is wrong') + find("td[id='#{line}']").hover + find(".is-over button").click + + page.within("form[data-line-code='#{line}']") do + fill_in('note_note', with: text) + click_button(button_text) + end + + wait_for_requests + end +end + +def write_reply_to_discussion(button_text: 'Start a review', text: 'Line is wrong', resolve: false, unresolve: false) + page.within(first('.diff-files-holder .discussion-reply-holder')) do + click_button('Reply...') + + fill_in('note_note', with: text) + + if resolve + page.check('Resolve thread') + end + + if unresolve + page.check('Unresolve thread') + end + + click_button(button_text) + end + + wait_for_requests +end diff --git a/spec/features/merge_request/maintainer_edits_fork_spec.rb b/spec/features/merge_request/maintainer_edits_fork_spec.rb index 17ff494a6fa..4db1633abe6 100644 --- a/spec/features/merge_request/maintainer_edits_fork_spec.rb +++ b/spec/features/merge_request/maintainer_edits_fork_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'a maintainer edits files on a source-branch of an MR from a fork', :js, :sidekiq_might_not_need_inline do +RSpec.describe 'a maintainer edits files on a source-branch of an MR from a fork', :js, :sidekiq_might_not_need_inline do include ProjectForksHelper let(:user) { create(:user, username: 'the-maintainer') } let(:target_project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_accepts_merge_request_spec.rb b/spec/features/merge_request/user_accepts_merge_request_spec.rb index 5e1ff232b80..d7c9c8bddb1 100644 --- a/spec/features/merge_request/user_accepts_merge_request_spec.rb +++ b/spec/features/merge_request/user_accepts_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inline do +RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inline do let(:merge_request) { create(:merge_request, :with_diffs, :simple, source_project: project) } let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } diff --git a/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb b/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb index 0ecd32565d0..fd13083c185 100644 --- a/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb +++ b/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'create a merge request, allowing commits from members who can merge to the target branch', :js do +RSpec.describe 'create a merge request, allowing commits from members who can merge to the target branch', :js do include ProjectForksHelper let(:user) { create(:user) } let(:target_project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_assigns_themselves_spec.rb b/spec/features/merge_request/user_assigns_themselves_spec.rb index 549d6e50337..b6cd97dcc5a 100644 --- a/spec/features/merge_request/user_assigns_themselves_spec.rb +++ b/spec/features/merge_request/user_assigns_themselves_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User assigns themselves' do +RSpec.describe 'Merge request > User assigns themselves' do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:issue1) { create(:issue, project: project) } diff --git a/spec/features/merge_request/user_awards_emoji_spec.rb b/spec/features/merge_request/user_awards_emoji_spec.rb index 8aa90107251..62e4209f386 100644 --- a/spec/features/merge_request/user_awards_emoji_spec.rb +++ b/spec/features/merge_request/user_awards_emoji_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User awards emoji', :js do +RSpec.describe 'Merge request > User awards emoji', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project, author: create(:user)) } diff --git a/spec/features/merge_request/user_clicks_merge_request_tabs_spec.rb b/spec/features/merge_request/user_clicks_merge_request_tabs_spec.rb new file mode 100644 index 00000000000..f3cbc1ea1f5 --- /dev/null +++ b/spec/features/merge_request/user_clicks_merge_request_tabs_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'User clicks on merge request tabs', :js do + let(:project) { create(:project, :public, :repository) } + let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } + + it 'adds entry to page history' do + visit('/') + visit(merge_request_path(merge_request)) + click_link('Changes') + + expect(current_url).to match(/diffs$/) + + page.driver.go_back + + expect(current_url).to match(merge_request_path(merge_request)) + + page.driver.go_back + + expect(current_url).to match('/') + end +end diff --git a/spec/features/merge_request/user_closes_merge_request_spec.rb b/spec/features/merge_request/user_closes_merge_request_spec.rb index c5125c38ed7..669bd989f4f 100644 --- a/spec/features/merge_request/user_closes_merge_request_spec.rb +++ b/spec/features/merge_request/user_closes_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User closes a merge requests', :js do +RSpec.describe 'User closes a merge requests', :js do let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } diff --git a/spec/features/merge_request/user_comments_on_commit_spec.rb b/spec/features/merge_request/user_comments_on_commit_spec.rb index 6b869d93e4c..8fa1fe3812d 100644 --- a/spec/features/merge_request/user_comments_on_commit_spec.rb +++ b/spec/features/merge_request/user_comments_on_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User comments on a commit', :js do +RSpec.describe 'User comments on a commit', :js do include MergeRequestDiffHelpers include RepoHelpers diff --git a/spec/features/merge_request/user_comments_on_diff_spec.rb b/spec/features/merge_request/user_comments_on_diff_spec.rb index 19b8a7f74b7..9cd3c7eaf76 100644 --- a/spec/features/merge_request/user_comments_on_diff_spec.rb +++ b/spec/features/merge_request/user_comments_on_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User comments on a diff', :js do +RSpec.describe 'User comments on a diff', :js do include MergeRequestDiffHelpers include RepoHelpers @@ -27,7 +27,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: 'Line is wrong') - click_button('Comment') + click_button('Add comment now') end page.within('.diff-files-holder > div:nth-child(3)') do @@ -46,7 +46,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: 'Line is correct') - click_button('Comment') + click_button('Add comment now') end wait_for_requests @@ -59,7 +59,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: 'Line is wrong') - click_button('Comment') + click_button('Add comment now') end wait_for_requests @@ -114,13 +114,47 @@ describe 'User comments on a diff', :js do include_examples 'comment on merge request file' end + context 'when adding multiline comments' do + it 'saves a multiline comment' do + click_diff_line(find("[id='#{sample_commit.line_code}']")) + + page.within('.discussion-form') do + find('#comment-line-start option', text: '-13').select_option + end + + page.within('.js-discussion-note-form') do + fill_in(:note_note, with: 'Line is wrong') + click_button('Add comment now') + end + + wait_for_requests + + page.within('.notes_holder') do + expect(page).to have_content('Line is wrong') + expect(page).to have_content('Comment on lines -13 to +14') + end + + visit(merge_request_path(merge_request)) + + page.within('.notes .discussion') do + expect(page).to have_content("#{user.name} #{user.to_reference} started a thread") + expect(page).to have_content(sample_commit.line_code_path) + expect(page).to have_content('Line is wrong') + end + + page.within('.notes-tab .badge') do + expect(page).to have_content('1') + end + end + end + context 'when editing comments' do it 'edits a comment' do click_diff_line(find("[id='#{sample_commit.line_code}']")) page.within('.js-discussion-note-form') do fill_in(:note_note, with: 'Line is wrong') - click_button('Comment') + click_button('Add comment now') end page.within('.diff-file:nth-of-type(5) .discussion .note') do @@ -146,7 +180,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in(:note_note, with: 'Line is wrong') - click_button('Comment') + click_button('Add comment now') end page.within('.notes-tab .badge') do diff --git a/spec/features/merge_request/user_comments_on_merge_request_spec.rb b/spec/features/merge_request/user_comments_on_merge_request_spec.rb index c7845b4cce4..73f2b1a25ce 100644 --- a/spec/features/merge_request/user_comments_on_merge_request_spec.rb +++ b/spec/features/merge_request/user_comments_on_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User comments on a merge request', :js do +RSpec.describe 'User comments on a merge request', :js do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb index cea9056cd93..34eaca24a01 100644 --- a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb +++ b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User creates image diff notes', :js do +RSpec.describe 'Merge request > User creates image diff notes', :js do include NoteInteractionHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_creates_merge_request_spec.rb b/spec/features/merge_request/user_creates_merge_request_spec.rb index 86ee9fa5aa5..37d329d4d5d 100644 --- a/spec/features/merge_request/user_creates_merge_request_spec.rb +++ b/spec/features/merge_request/user_creates_merge_request_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User creates a merge request", :js do +RSpec.describe "User creates a merge request", :js do include ProjectForksHelper let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/merge_request/user_creates_mr_spec.rb b/spec/features/merge_request/user_creates_mr_spec.rb index 665bc352c0f..9d97e57fe3a 100644 --- a/spec/features/merge_request/user_creates_mr_spec.rb +++ b/spec/features/merge_request/user_creates_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User creates MR' do +RSpec.describe 'Merge request > User creates MR' do include ProjectForksHelper before do diff --git a/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb b/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb index 895cbb8f02b..23df7635aa1 100644 --- a/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb +++ b/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request < User customizes merge commit message', :js do +RSpec.describe 'Merge request < User customizes merge commit message', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:issue_1) { create(:issue, project: project)} diff --git a/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb b/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb index e6b77e28281..affd6f6b7b5 100644 --- a/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb +++ b/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User edits assignees sidebar', :js do +RSpec.describe 'Merge request > User edits assignees sidebar', :js do let(:project) { create(:project, :public, :repository) } let(:protected_branch) { create(:protected_branch, :maintainers_can_push, name: 'master', project: project) } let(:merge_request) { create(:merge_request, :simple, source_project: project, target_branch: protected_branch.name) } @@ -20,49 +20,102 @@ describe 'Merge request > User edits assignees sidebar', :js do let(:sidebar_assignee_dropdown_item) { sidebar_assignee_block.find(".dropdown-menu li[data-user-id=\"#{assignee.id}\"]") } let(:sidebar_assignee_dropdown_tooltip) { sidebar_assignee_dropdown_item.find('a')['data-title'] || '' } - before do - stub_const('Autocomplete::UsersFinder::LIMIT', users_find_limit) + context 'when invite_members_version_a experiment is not enabled' do + before do + stub_const('Autocomplete::UsersFinder::LIMIT', users_find_limit) - sign_in(project.owner) + sign_in(project.owner) - merge_request.assignees << assignee + merge_request.assignees << assignee - visit project_merge_request_path(project, merge_request) + visit project_merge_request_path(project, merge_request) - wait_for_requests - end + wait_for_requests + end + + shared_examples 'when assigned' do |expected_tooltip: ''| + it 'shows assignee name' do + expect(sidebar_assignee_block).to have_text(assignee.name) + end + + it "shows assignee tooltip '#{expected_tooltip}'" do + expect(sidebar_assignee_tooltip).to eql(expected_tooltip) + end + + context 'when edit is clicked' do + before do + sidebar_assignee_block.click_link('Edit') + + wait_for_requests + end + + it "shows assignee tooltip '#{expected_tooltip}" do + expect(sidebar_assignee_dropdown_tooltip).to eql(expected_tooltip) + end + + it 'does not show invite link' do + page.within '.dropdown-menu-user' do + expect(page).not_to have_link('Invite Members') + end + end + end + end + + context 'when assigned to maintainer' do + let(:assignee) { project_maintainers.last } - shared_examples 'when assigned' do |expected_tooltip: ''| - it 'shows assignee name' do - expect(sidebar_assignee_block).to have_text(assignee.name) + it_behaves_like 'when assigned', expected_tooltip: '' end - it "shows assignee tooltip '#{expected_tooltip}'" do - expect(sidebar_assignee_tooltip).to eql(expected_tooltip) + context 'when assigned to developer' do + let(:assignee) { project_developers.last } + + it_behaves_like 'when assigned', expected_tooltip: 'Cannot merge' end + end - context 'when edit is clicked' do + context 'when invite_members_version_a experiment is enabled' do + let_it_be(:user) { create(:user) } + + before do + stub_experiment_for_user(invite_members_version_a: true) + sign_in(user) + end + + context 'when user can not see invite members' do before do - sidebar_assignee_block.click_link('Edit') + project.add_developer(user) + visit project_merge_request_path(project, merge_request) + + find('.block.assignee .edit-link').click wait_for_requests end - it "shows assignee tooltip '#{expected_tooltip}" do - expect(sidebar_assignee_dropdown_tooltip).to eql(expected_tooltip) + it 'does not see link to invite members' do + page.within '.dropdown-menu-user' do + expect(page).not_to have_link('Invite Members') + end end end - end - context 'when assigned to maintainer' do - let(:assignee) { project_maintainers.last } + context 'when user can see invite members' do + before do + project.add_maintainer(user) + visit project_merge_request_path(project, merge_request) - it_behaves_like 'when assigned', expected_tooltip: '' - end + find('.block.assignee .edit-link').click - context 'when assigned to developer' do - let(:assignee) { project_developers.last } + wait_for_requests + end - it_behaves_like 'when assigned', expected_tooltip: 'Cannot merge' + it 'sees link to invite members' do + page.within '.dropdown-menu-user' do + expect(page).to have_link('Invite Members', href: project_project_members_path(project)) + expect(page).to have_selector('[data-track-event="click_invite_members"]') + expect(page).to have_selector("[data-track-label='edit_assignee']") + end + end + end end end diff --git a/spec/features/merge_request/user_edits_merge_request_spec.rb b/spec/features/merge_request/user_edits_merge_request_spec.rb index 821db8a1d5b..84ecd6537dc 100644 --- a/spec/features/merge_request/user_edits_merge_request_spec.rb +++ b/spec/features/merge_request/user_edits_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User edits a merge request', :js do +RSpec.describe 'User edits a merge request', :js do include Select2Helper let(:project) { create(:project, :repository) } diff --git a/spec/features/merge_request/user_edits_mr_spec.rb b/spec/features/merge_request/user_edits_mr_spec.rb index e6b847c5e7f..2c949ed84f4 100644 --- a/spec/features/merge_request/user_edits_mr_spec.rb +++ b/spec/features/merge_request/user_edits_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User edits MR' do +RSpec.describe 'Merge request > User edits MR' do include ProjectForksHelper before do diff --git a/spec/features/merge_request/user_expands_diff_spec.rb b/spec/features/merge_request/user_expands_diff_spec.rb index 9bce5264817..d3867a91846 100644 --- a/spec/features/merge_request/user_expands_diff_spec.rb +++ b/spec/features/merge_request/user_expands_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User expands diff', :js do +RSpec.describe 'User expands diff', :js do let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_branch: 'expand-collapse-files', source_project: project, target_project: project) } diff --git a/spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb b/spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb index 2a4192374bd..1a7baff2fb1 100644 --- a/spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb +++ b/spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Batch diffs', :js do +RSpec.describe 'Batch diffs', :js do include MergeRequestDiffHelpers include RepoHelpers @@ -22,14 +22,14 @@ describe 'Batch diffs', :js do click_diff_line(find('.diff-file.file-holder:first-of-type tr.line_holder.new:first-of-type')) page.within('.js-discussion-note-form') do fill_in('note_note', with: 'First Line Comment') - click_button('Comment') + click_button('Add comment now') end # Add discussion to first line of last file click_diff_line(find('.diff-file.file-holder:last-of-type tr.line_holder.new:first-of-type')) page.within('.js-discussion-note-form') do fill_in('note_note', with: 'Last Line Comment') - click_button('Comment') + click_button('Add comment now') end wait_for_requests diff --git a/spec/features/merge_request/user_locks_discussion_spec.rb b/spec/features/merge_request/user_locks_discussion_spec.rb index 0eaaf32dc31..c8a6fdd4007 100644 --- a/spec/features/merge_request/user_locks_discussion_spec.rb +++ b/spec/features/merge_request/user_locks_discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User locks discussion', :js do +RSpec.describe 'Merge request > User locks discussion', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/merge_request/user_manages_subscription_spec.rb b/spec/features/merge_request/user_manages_subscription_spec.rb index 54d27a06bb1..9ed5b67fa0e 100644 --- a/spec/features/merge_request/user_manages_subscription_spec.rb +++ b/spec/features/merge_request/user_manages_subscription_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User manages subscription', :js do +RSpec.describe 'User manages subscription', :js do let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } diff --git a/spec/features/merge_request/user_merges_immediately_spec.rb b/spec/features/merge_request/user_merges_immediately_spec.rb index 1188d3b2ceb..47dc09ae79f 100644 --- a/spec/features/merge_request/user_merges_immediately_spec.rb +++ b/spec/features/merge_request/user_merges_immediately_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge requests > User merges immediately', :js do +RSpec.describe 'Merge requests > User merges immediately', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let!(:merge_request) do diff --git a/spec/features/merge_request/user_merges_merge_request_spec.rb b/spec/features/merge_request/user_merges_merge_request_spec.rb index 32e40740a61..7758fa8e666 100644 --- a/spec/features/merge_request/user_merges_merge_request_spec.rb +++ b/spec/features/merge_request/user_merges_merge_request_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User merges a merge request", :js do +RSpec.describe "User merges a merge request", :js do let(:user) { project.owner } before do diff --git a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb index 419f741d0ea..ea3e90a4508 100644 --- a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb +++ b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User merges only if pipeline succeeds', :js do +RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js do let(:merge_request) { create(:merge_request_with_diffs) } let(:project) { merge_request.target_project } diff --git a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb index 5cc61333bb4..d5ff31de073 100644 --- a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb +++ b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User merges when pipeline succeeds', :js do +RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) do diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb index ebfb5ce796f..dbad2f191a1 100644 --- a/spec/features/merge_request/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User posts diff notes', :js do +RSpec.describe 'Merge request > User posts diff notes', :js do include MergeRequestDiffHelpers let(:merge_request) { create(:merge_request) } @@ -225,7 +225,7 @@ describe 'Merge request > User posts diff notes', :js do def should_allow_commenting(line_holder, diff_side = nil, asset_form_reset: true) write_comment_on_line(line_holder, diff_side) - click_button 'Comment' + click_button 'Add comment now' wait_for_requests diff --git a/spec/features/merge_request/user_posts_notes_spec.rb b/spec/features/merge_request/user_posts_notes_spec.rb index 0548d958322..3c70819319d 100644 --- a/spec/features/merge_request/user_posts_notes_spec.rb +++ b/spec/features/merge_request/user_posts_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User posts notes', :js do +RSpec.describe 'Merge request > User posts notes', :js do include NoteInteractionHelpers let_it_be(:project) { create(:project, :repository) } @@ -105,7 +105,7 @@ describe 'Merge request > User posts notes', :js do page.within('.discussion-reply-holder') do fill_in 'note[note]', with: 'A reply' - click_button 'Comment' + click_button 'Add comment now' wait_for_requests expect(page).to have_content('Your comment could not be submitted because discussion to reply to cannot be found') end diff --git a/spec/features/merge_request/user_rebases_merge_request_spec.rb b/spec/features/merge_request/user_rebases_merge_request_spec.rb index 34f009000dc..a3f72a6266b 100644 --- a/spec/features/merge_request/user_rebases_merge_request_spec.rb +++ b/spec/features/merge_request/user_rebases_merge_request_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User rebases a merge request", :js do +RSpec.describe "User rebases a merge request", :js do let(:merge_request) { create(:merge_request, :simple, source_project: project) } let(:user) { project.owner } diff --git a/spec/features/merge_request/user_reopens_merge_request_spec.rb b/spec/features/merge_request/user_reopens_merge_request_spec.rb index 6dee5770d0c..020929dc416 100644 --- a/spec/features/merge_request/user_reopens_merge_request_spec.rb +++ b/spec/features/merge_request/user_reopens_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User reopens a merge requests', :js do +RSpec.describe 'User reopens a merge requests', :js do let(:project) { create(:project, :public, :repository) } let!(:merge_request) { create(:closed_merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } diff --git a/spec/features/merge_request/user_resolves_conflicts_spec.rb b/spec/features/merge_request/user_resolves_conflicts_spec.rb index 41a7456aed5..f96408fb10b 100644 --- a/spec/features/merge_request/user_resolves_conflicts_spec.rb +++ b/spec/features/merge_request/user_resolves_conflicts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User resolves conflicts', :js do +RSpec.describe 'Merge request > User resolves conflicts', :js do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index 0e30df518d7..aa3840b4376 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User resolves diff notes and threads', :js do +RSpec.describe 'Merge request > User resolves diff notes and threads', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:guest) { create(:user) } @@ -146,17 +146,16 @@ describe 'Merge request > User resolves diff notes and threads', :js do describe 'reply form' do before do click_button 'Toggle thread' - - page.within '.diff-content' do - click_button 'Reply...' - end end it 'allows user to comment' do page.within '.diff-content' do + click_button 'Reply...' + + find(".js-unresolve-checkbox").set false find('.js-note-text').set 'testing' - click_button 'Comment' + click_button 'Add comment now' wait_for_requests end @@ -181,9 +180,11 @@ describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to comment & unresolve thread' do page.within '.diff-content' do + click_button 'Reply...' + find('.js-note-text').set 'testing' - click_button 'Comment & unresolve thread' + click_button 'Add comment now' wait_for_requests end @@ -197,8 +198,6 @@ describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to resolve from reply form without a comment' do page.within '.diff-content' do - click_button 'Reply...' - click_button 'Resolve thread' end @@ -214,7 +213,9 @@ describe 'Merge request > User resolves diff notes and threads', :js do find('.js-note-text').set 'testing' - click_button 'Comment & resolve thread' + find('.js-resolve-checkbox').set(true) + + click_button 'Add comment now' end page.within '.line-resolve-all-container' do @@ -445,7 +446,9 @@ describe 'Merge request > User resolves diff notes and threads', :js do find('.js-note-text').set 'testing' - click_button 'Comment & resolve thread' + find('.js-resolve-checkbox').set(true) + + click_button 'Add comment now' end page.within '.line-resolve-all-container' do @@ -462,7 +465,7 @@ describe 'Merge request > User resolves diff notes and threads', :js do find('.js-note-text').set 'testing' - click_button 'Comment & unresolve thread' + click_button 'Add comment now' end page.within '.line-resolve-all-container' do diff --git a/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb b/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb index 9f7c97e510c..f8f3467f6fb 100644 --- a/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb +++ b/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User resolves outdated diff discussions', :js do +RSpec.describe 'Merge request > User resolves outdated diff discussions', :js do let(:project) { create(:project, :repository, :public) } let(:merge_request) do diff --git a/spec/features/merge_request/user_resolves_wip_mr_spec.rb b/spec/features/merge_request/user_resolves_wip_mr_spec.rb index 93ef0801791..34a3490a152 100644 --- a/spec/features/merge_request/user_resolves_wip_mr_spec.rb +++ b/spec/features/merge_request/user_resolves_wip_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User resolves Work in Progress', :js do +RSpec.describe 'Merge request > User resolves Work in Progress', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) do diff --git a/spec/features/merge_request/user_reverts_merge_request_spec.rb b/spec/features/merge_request/user_reverts_merge_request_spec.rb index 906ff1d61b2..5e9611de460 100644 --- a/spec/features/merge_request/user_reverts_merge_request_spec.rb +++ b/spec/features/merge_request/user_reverts_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User reverts a merge request', :js do +RSpec.describe 'User reverts a merge request', :js do let(:merge_request) { create(:merge_request, :with_diffs, :simple, source_project: project) } let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } diff --git a/spec/features/merge_request/user_reviews_image_spec.rb b/spec/features/merge_request/user_reviews_image_spec.rb new file mode 100644 index 00000000000..533f3c9c91a --- /dev/null +++ b/spec/features/merge_request/user_reviews_image_spec.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Merge request > image review', :js do + include MergeRequestDiffHelpers + include RepoHelpers + + let(:user) { project.owner } + let(:project) { create(:project, :repository) } + let(:merge_request) { create(:merge_request_with_diffs, :with_image_diffs, source_project: project, author: user) } + + before do + sign_in(user) + + allow_any_instance_of(DiffHelper).to receive(:diff_file_blob_raw_url).and_return('/apple-touch-icon.png') + allow_any_instance_of(DiffHelper).to receive(:diff_file_old_blob_raw_url).and_return('/favicon.png') + + visit diffs_project_merge_request_path(merge_request.project, merge_request) + + wait_for_requests + end + + it 'leaves review' do + find('.js-add-image-diff-note-button', match: :first).click + + find('.diff-content .note-textarea').native.send_keys('image diff test comment') + + click_button('Start a review') + + wait_for_requests + + page.within(find('.draft-note-component')) do + expect(page).to have_content('image diff test comment') + end + end +end diff --git a/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb b/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb index 48c3ed7178d..d9950f5504b 100644 --- a/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb +++ b/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User scrolls to note on load', :js do +RSpec.describe 'Merge request > User scrolls to note on load', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project, author: user) } diff --git a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb index 21599164ac3..415e6b29d5a 100644 --- a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb +++ b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees avatars on diff notes', :js do +RSpec.describe 'Merge request > User sees avatars on diff notes', :js do include NoteInteractionHelpers let(:project) { create(:project, :public, :repository) } @@ -42,7 +42,7 @@ describe 'Merge request > User sees avatars on diff notes', :js do page.within('.js-discussion-note-form') do find('.note-textarea').native.send_keys('Test comment') - click_button 'Comment' + click_button 'Add comment now' end expect(page).to have_content('Test comment') @@ -137,7 +137,7 @@ describe 'Merge request > User sees avatars on diff notes', :js do page.within '.js-discussion-note-form' do find('.js-note-text').native.send_keys('Test') - click_button 'Comment' + click_button 'Add comment now' wait_for_requests end @@ -155,7 +155,7 @@ describe 'Merge request > User sees avatars on diff notes', :js do page.within '.js-discussion-note-form' do find('.js-note-text').native.send_keys('Test') - find('.js-comment-button').click + click_button 'Add comment now' wait_for_requests end diff --git a/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb b/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb index 592ad3aae9b..95e435a333e 100644 --- a/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/merge_request/user_sees_breadcrumb_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New merge request breadcrumb' do +RSpec.describe 'New merge request breadcrumb' do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb b/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb index f54161fbaec..e47f9ff2660 100644 --- a/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb +++ b/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees check out branch modal', :js do +RSpec.describe 'Merge request > User sees check out branch modal', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb b/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb index d7675cd06a8..ec2fb856be5 100644 --- a/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb +++ b/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User cherry-picks', :js do +RSpec.describe 'Merge request > User cherry-picks', :js do let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_sees_closing_issues_message_spec.rb b/spec/features/merge_request/user_sees_closing_issues_message_spec.rb index f77ea82649c..baef547a480 100644 --- a/spec/features/merge_request/user_sees_closing_issues_message_spec.rb +++ b/spec/features/merge_request/user_sees_closing_issues_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees closing issues message', :js do +RSpec.describe 'Merge request > User sees closing issues message', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:issue_1) { create(:issue, project: project)} diff --git a/spec/features/merge_request/user_sees_deleted_target_branch_spec.rb b/spec/features/merge_request/user_sees_deleted_target_branch_spec.rb index 9ef6847f7f5..7c93952ee99 100644 --- a/spec/features/merge_request/user_sees_deleted_target_branch_spec.rb +++ b/spec/features/merge_request/user_sees_deleted_target_branch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees deleted target branch', :js do +RSpec.describe 'Merge request > User sees deleted target branch', :js do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.project } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_sees_deployment_widget_spec.rb b/spec/features/merge_request/user_sees_deployment_widget_spec.rb index 9670bd798bf..1e547d504ef 100644 --- a/spec/features/merge_request/user_sees_deployment_widget_spec.rb +++ b/spec/features/merge_request/user_sees_deployment_widget_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees deployment widget', :js do +RSpec.describe 'Merge request > User sees deployment widget', :js do describe 'when merge request has associated environments' do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/merge_request/user_sees_diff_spec.rb b/spec/features/merge_request/user_sees_diff_spec.rb index 868451883d8..2229b242d5b 100644 --- a/spec/features/merge_request/user_sees_diff_spec.rb +++ b/spec/features/merge_request/user_sees_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees diff', :js do +RSpec.describe 'Merge request > User sees diff', :js do include ProjectForksHelper include RepoHelpers diff --git a/spec/features/merge_request/user_sees_discussions_spec.rb b/spec/features/merge_request/user_sees_discussions_spec.rb index b4afd8c6332..ca8c4f84677 100644 --- a/spec/features/merge_request/user_sees_discussions_spec.rb +++ b/spec/features/merge_request/user_sees_discussions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees threads', :js do +RSpec.describe 'Merge request > User sees threads', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/merge_request/user_sees_empty_state_spec.rb b/spec/features/merge_request/user_sees_empty_state_spec.rb index 88eba976d62..ac07b31731d 100644 --- a/spec/features/merge_request/user_sees_empty_state_spec.rb +++ b/spec/features/merge_request/user_sees_empty_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees empty state' do +RSpec.describe 'Merge request > User sees empty state' do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb b/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb index 4cc129e5d5f..cae04dd1693 100644 --- a/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb +++ b/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees merge button depending on unresolved threads', :js do +RSpec.describe 'Merge request > User sees merge button depending on unresolved threads', :js do let(:project) { create(:project, :repository) } let(:user) { project.creator } let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) } diff --git a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb index 5b14450a289..e2aa10d80dd 100644 --- a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees pipelines triggered by merge request', :js do +RSpec.describe 'Merge request > User sees pipelines triggered by merge request', :js do include ProjectForksHelper include TestReportsHelper diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index eca011bc786..bd140a0643d 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees merge widget', :js do +RSpec.describe 'Merge request > User sees merge widget', :js do include ProjectForksHelper include TestReportsHelper include ReactiveCachingHelpers diff --git a/spec/features/merge_request/user_sees_mini_pipeline_graph_spec.rb b/spec/features/merge_request/user_sees_mini_pipeline_graph_spec.rb index 29b8dc19860..04d8c52df61 100644 --- a/spec/features/merge_request/user_sees_mini_pipeline_graph_spec.rb +++ b/spec/features/merge_request/user_sees_mini_pipeline_graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request < User sees mini pipeline graph', :js do +RSpec.describe 'Merge request < User sees mini pipeline graph', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project, head_pipeline: pipeline) } diff --git a/spec/features/merge_request/user_sees_mr_from_deleted_forked_project_spec.rb b/spec/features/merge_request/user_sees_mr_from_deleted_forked_project_spec.rb index b4fb844b943..cbd68025b50 100644 --- a/spec/features/merge_request/user_sees_mr_from_deleted_forked_project_spec.rb +++ b/spec/features/merge_request/user_sees_mr_from_deleted_forked_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees MR from deleted forked project', :js do +RSpec.describe 'Merge request > User sees MR from deleted forked project', :js do include ProjectForksHelper let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb index 59e5f5c847d..e997fb3e853 100644 --- a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb +++ b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' # This test serves as a regression test for a bug that caused an error # message to be shown by JavaScript when the source branch was deleted. # Please do not remove ":js". -describe 'Merge request > User sees MR with deleted source branch', :js do +RSpec.describe 'Merge request > User sees MR with deleted source branch', :js do let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb b/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb index 029f55c2cd6..20c45a1d652 100644 --- a/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb +++ b/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees notes from forked project', :js do +RSpec.describe 'Merge request > User sees notes from forked project', :js do include ProjectForksHelper let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_sees_pipelines_from_forked_project_spec.rb b/spec/features/merge_request/user_sees_pipelines_from_forked_project_spec.rb index d258b98f4a9..56092da5136 100644 --- a/spec/features/merge_request/user_sees_pipelines_from_forked_project_spec.rb +++ b/spec/features/merge_request/user_sees_pipelines_from_forked_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees pipelines from forked project', :js do +RSpec.describe 'Merge request > User sees pipelines from forked project', :js do include ProjectForksHelper let(:target_project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_sees_pipelines_spec.rb b/spec/features/merge_request/user_sees_pipelines_spec.rb index f3d8f2b42f8..2d125087cb6 100644 --- a/spec/features/merge_request/user_sees_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_pipelines_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees pipelines', :js do +RSpec.describe 'Merge request > User sees pipelines', :js do describe 'pipeline tab' do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.target_project } diff --git a/spec/features/merge_request/user_sees_system_notes_spec.rb b/spec/features/merge_request/user_sees_system_notes_spec.rb index 0482458d5ac..9f8d4c6d63f 100644 --- a/spec/features/merge_request/user_sees_system_notes_spec.rb +++ b/spec/features/merge_request/user_sees_system_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees system notes', :js do +RSpec.describe 'Merge request > User sees system notes', :js do let(:public_project) { create(:project, :public, :repository) } let(:private_project) { create(:project, :private, :repository) } let(:user) { private_project.creator } diff --git a/spec/features/merge_request/user_sees_versions_spec.rb b/spec/features/merge_request/user_sees_versions_spec.rb index 5b43fe407eb..75319c8a22d 100644 --- a/spec/features/merge_request/user_sees_versions_spec.rb +++ b/spec/features/merge_request/user_sees_versions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees versions', :js do +RSpec.describe 'Merge request > User sees versions', :js do let(:merge_request) do create(:merge_request).tap do |mr| mr.merge_request_diff.destroy @@ -34,7 +34,7 @@ describe 'Merge request > User sees versions', :js do page.within("form[data-line-code='#{line_code}']") do fill_in "note[note]", with: comment - find(".js-comment-button").click + click_button('Add comment now') end wait_for_requests diff --git a/spec/features/merge_request/user_sees_wip_help_message_spec.rb b/spec/features/merge_request/user_sees_wip_help_message_spec.rb index 1179303171c..42fe18cfc93 100644 --- a/spec/features/merge_request/user_sees_wip_help_message_spec.rb +++ b/spec/features/merge_request/user_sees_wip_help_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees WIP help message' do +RSpec.describe 'Merge request > User sees WIP help message' do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb b/spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb index 22b2ea81b32..bf445de44ba 100644 --- a/spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb +++ b/spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User selects branches for new MR', :js do +RSpec.describe 'Merge request > User selects branches for new MR', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb index 62e0e4d76ed..b81c0e49538 100644 --- a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb +++ b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User comments on a diff', :js do +RSpec.describe 'User comments on a diff', :js do include MergeRequestDiffHelpers include RepoHelpers @@ -49,7 +49,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion\n# change to a comment\n```") - click_button('Comment') + click_button('Add comment now') end wait_for_requests @@ -77,7 +77,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion\n# change to a comment\n```") - click_button('Comment') + click_button('Add comment now') end wait_for_requests @@ -93,6 +93,100 @@ describe 'User comments on a diff', :js do end end + context 'applying suggestions in batches' do + def hash(path) + diff_file = merge_request.diffs(paths: [path]).diff_files.first + Digest::SHA1.hexdigest(diff_file.file_path) + end + + file1 = 'files/ruby/popen.rb' + file2 = 'files/ruby/regex.rb' + + let(:files) do + [ + { + hash: hash(file1), + line_code: "#{hash(file1)}_12_12" + }, + { + hash: hash(file2), + line_code: "#{hash(file2)}_21_21" + } + ] + end + + it 'can add and remove suggestions from a batch' do + files.each_with_index do |file, index| + page.within("[id='#{file[:hash]}']") do + find("button[title='Show full file']").click + wait_for_requests + + click_diff_line(find("[id='#{file[:line_code]}']")) + + page.within('.js-discussion-note-form') do + fill_in('note_note', with: "```suggestion\n# change to a comment\n```") + click_button('Add comment now') + wait_for_requests + end + end + + page.within("[id='#{file[:hash]}']") do + expect(page).not_to have_content('Applied') + + click_button('Add suggestion to batch') + wait_for_requests + + expect(page).to have_content('Remove from batch') + expect(page).to have_content("Apply suggestions #{index + 1}") + end + end + + page.within("[id='#{files[0][:hash]}']") do + click_button('Remove from batch') + wait_for_requests + + expect(page).to have_content('Apply suggestion') + expect(page).to have_content('Add suggestion to batch') + end + + page.within("[id='#{files[1][:hash]}']") do + expect(page).to have_content('Remove from batch') + expect(page).to have_content('Apply suggestions 1') + end + end + + it 'can apply multiple suggestions as a batch' do + files.each_with_index do |file, index| + page.within("[id='#{file[:hash]}']") do + find("button[title='Show full file']").click + wait_for_requests + + click_diff_line(find("[id='#{file[:line_code]}']")) + + page.within('.js-discussion-note-form') do + fill_in('note_note', with: "```suggestion\n# change to a comment\n```") + click_button('Add comment now') + wait_for_requests + end + end + + page.within("[id='#{file[:hash]}']") do + click_button('Add suggestion to batch') + wait_for_requests + end + end + + expect(page).not_to have_content('Applied') + + page.within("[id='#{files[0][:hash]}']") do + click_button('Apply suggestions 2') + wait_for_requests + end + + expect(page).to have_content('Applied').twice + end + end + context 'multiple suggestions in expanded lines' do # https://gitlab.com/gitlab-org/gitlab/issues/38277 it 'suggestions are appliable', :quarantine do @@ -119,7 +213,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion\n# change to a comment\n```") - click_button('Comment') + click_button('Add comment now') wait_for_requests end @@ -127,7 +221,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion\n# 2nd change to a comment\n```") - click_button('Comment') + click_button('Add comment now') wait_for_requests end @@ -158,7 +252,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion\n# change to a comment\n```\n```suggestion:-2\n# or that\n# heh\n```") - click_button('Comment') + click_button('Add comment now') end wait_for_requests @@ -201,7 +295,7 @@ describe 'User comments on a diff', :js do page.within('.js-discussion-note-form') do fill_in('note_note', with: "```suggestion:-3+5\n# change to a\n# comment\n# with\n# broken\n# lines\n```") - click_button('Comment') + click_button('Add comment now') end wait_for_requests diff --git a/spec/features/merge_request/user_toggles_whitespace_changes_spec.rb b/spec/features/merge_request/user_toggles_whitespace_changes_spec.rb index 4db067a4e41..fab500f47bf 100644 --- a/spec/features/merge_request/user_toggles_whitespace_changes_spec.rb +++ b/spec/features/merge_request/user_toggles_whitespace_changes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User toggles whitespace changes', :js do +RSpec.describe 'Merge request > User toggles whitespace changes', :js do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.project } let(:user) { project.creator } diff --git a/spec/features/merge_request/user_tries_to_access_private_project_info_through_new_mr_spec.rb b/spec/features/merge_request/user_tries_to_access_private_project_info_through_new_mr_spec.rb index 1ebe9e2e409..b864cb55785 100644 --- a/spec/features/merge_request/user_tries_to_access_private_project_info_through_new_mr_spec.rb +++ b/spec/features/merge_request/user_tries_to_access_private_project_info_through_new_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Request > User tries to access private project information through the new mr page' do +RSpec.describe 'Merge Request > User tries to access private project information through the new mr page' do let(:current_user) { create(:user) } let(:private_project) do create(:project, :public, :repository, diff --git a/spec/features/merge_request/user_uses_quick_actions_spec.rb b/spec/features/merge_request/user_uses_quick_actions_spec.rb index 318f8812263..04a2e046f42 100644 --- a/spec/features/merge_request/user_uses_quick_actions_spec.rb +++ b/spec/features/merge_request/user_uses_quick_actions_spec.rb @@ -7,7 +7,7 @@ require 'spec_helper' # for example, adding quick actions when creating the issue and checking DateTime formats on UI. # Because this kind of spec takes more time to run there is no need to add new ones # for each existing quick action unless they test something not tested by existing tests. -describe 'Merge request > User uses quick actions', :js do +RSpec.describe 'Merge request > User uses quick actions', :js do include Spec::Support::Helpers::Features::NotesHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb index cd0cf1cc78a..14d10fc1c9f 100644 --- a/spec/features/merge_request/user_views_diffs_spec.rb +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views diffs', :js do +RSpec.describe 'User views diffs', :js do let(:merge_request) do create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') end diff --git a/spec/features/merge_request/user_views_merge_request_from_deleted_fork_spec.rb b/spec/features/merge_request/user_views_merge_request_from_deleted_fork_spec.rb index a38bc4f702b..370341a43f9 100644 --- a/spec/features/merge_request/user_views_merge_request_from_deleted_fork_spec.rb +++ b/spec/features/merge_request/user_views_merge_request_from_deleted_fork_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper' # updated. # This can occur when the fork a merge request is created from is in the process # of being destroyed. -describe 'User views merged merge request from deleted fork' do +RSpec.describe 'User views merged merge request from deleted fork' do include ProjectForksHelper let(:project) { create(:project, :repository) } diff --git a/spec/features/merge_request/user_views_open_merge_request_spec.rb b/spec/features/merge_request/user_views_open_merge_request_spec.rb index a788fc71286..448844ae57d 100644 --- a/spec/features/merge_request/user_views_open_merge_request_spec.rb +++ b/spec/features/merge_request/user_views_open_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views an open merge request' do +RSpec.describe 'User views an open merge request' do let(:merge_request) do create(:merge_request, source_project: project, target_project: project, description: '# Description header') end diff --git a/spec/features/merge_request/user_views_user_status_on_merge_request_spec.rb b/spec/features/merge_request/user_views_user_status_on_merge_request_spec.rb index 78d9c6c6db1..a6de443e96f 100644 --- a/spec/features/merge_request/user_views_user_status_on_merge_request_spec.rb +++ b/spec/features/merge_request/user_views_user_status_on_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Merge request > View user status' do +RSpec.describe 'Project > Merge request > View user status' do let(:project) { create(:project, :public, :repository) } let(:merge_request) do create(:merge_request, source_project: project, target_project: project, author: create(:user)) diff --git a/spec/features/merge_requests/filters_generic_behavior_spec.rb b/spec/features/merge_requests/filters_generic_behavior_spec.rb index 2bea819cc33..80009cca2fb 100644 --- a/spec/features/merge_requests/filters_generic_behavior_spec.rb +++ b/spec/features/merge_requests/filters_generic_behavior_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Requests > Filters generic behavior', :js do +RSpec.describe 'Merge Requests > Filters generic behavior', :js do include FilteredSearchHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_filters_by_assignees_spec.rb b/spec/features/merge_requests/user_filters_by_assignees_spec.rb index 12d682bbb15..9827b067649 100644 --- a/spec/features/merge_requests/user_filters_by_assignees_spec.rb +++ b/spec/features/merge_requests/user_filters_by_assignees_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Requests > User filters by assignees', :js do +RSpec.describe 'Merge Requests > User filters by assignees', :js do include FilteredSearchHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_filters_by_labels_spec.rb b/spec/features/merge_requests/user_filters_by_labels_spec.rb index 6308579d2d9..980046ccd71 100644 --- a/spec/features/merge_requests/user_filters_by_labels_spec.rb +++ b/spec/features/merge_requests/user_filters_by_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Requests > User filters by labels', :js do +RSpec.describe 'Merge Requests > User filters by labels', :js do include FilteredSearchHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_filters_by_milestones_spec.rb b/spec/features/merge_requests/user_filters_by_milestones_spec.rb index d2a420be996..41a0b0012d1 100644 --- a/spec/features/merge_requests/user_filters_by_milestones_spec.rb +++ b/spec/features/merge_requests/user_filters_by_milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Requests > User filters by milestones', :js do +RSpec.describe 'Merge Requests > User filters by milestones', :js do include FilteredSearchHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_filters_by_multiple_criteria_spec.rb b/spec/features/merge_requests/user_filters_by_multiple_criteria_spec.rb index 5fac31e58ba..3aba023b077 100644 --- a/spec/features/merge_requests/user_filters_by_multiple_criteria_spec.rb +++ b/spec/features/merge_requests/user_filters_by_multiple_criteria_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge requests > User filters by multiple criteria', :js do +RSpec.describe 'Merge requests > User filters by multiple criteria', :js do include FilteredSearchHelpers let!(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_filters_by_target_branch_spec.rb b/spec/features/merge_requests/user_filters_by_target_branch_spec.rb index abe97d4c07e..540d87eb969 100644 --- a/spec/features/merge_requests/user_filters_by_target_branch_spec.rb +++ b/spec/features/merge_requests/user_filters_by_target_branch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Requests > User filters by target branch', :js do +RSpec.describe 'Merge Requests > User filters by target branch', :js do include FilteredSearchHelpers let!(:project) { create(:project, :public, :repository) } diff --git a/spec/features/merge_requests/user_lists_merge_requests_spec.rb b/spec/features/merge_requests/user_lists_merge_requests_spec.rb index ee0d7307e6c..4531ef40901 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge requests > User lists merge requests' do +RSpec.describe 'Merge requests > User lists merge requests' do include MergeRequestHelpers include SortingHelper diff --git a/spec/features/merge_requests/user_mass_updates_spec.rb b/spec/features/merge_requests/user_mass_updates_spec.rb index fa951dd50d3..df94fe2cbd0 100644 --- a/spec/features/merge_requests/user_mass_updates_spec.rb +++ b/spec/features/merge_requests/user_mass_updates_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge requests > User mass updates', :js do +RSpec.describe 'Merge requests > User mass updates', :js do let(:project) { create(:project, :repository) } let(:user) { project.creator } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } diff --git a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb index 5a84bcb0c44..54c9fbef218 100644 --- a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User sorts merge requests' do +RSpec.describe 'User sorts merge requests' do include CookieHelper let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } diff --git a/spec/features/merge_requests/user_squashes_merge_request_spec.rb b/spec/features/merge_requests/user_squashes_merge_request_spec.rb index ce5ed76dc7a..84964bd0637 100644 --- a/spec/features/merge_requests/user_squashes_merge_request_spec.rb +++ b/spec/features/merge_requests/user_squashes_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User squashes a merge request', :js do +RSpec.describe 'User squashes a merge request', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:source_branch) { 'csv' } diff --git a/spec/features/merge_requests/user_views_all_merge_requests_spec.rb b/spec/features/merge_requests/user_views_all_merge_requests_spec.rb index 60496d61e87..f8fe2c5ebe2 100644 --- a/spec/features/merge_requests/user_views_all_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_views_all_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views all merge requests' do +RSpec.describe 'User views all merge requests' do let!(:closed_merge_request) { create(:closed_merge_request, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:project) { create(:project, :public) } diff --git a/spec/features/merge_requests/user_views_closed_merge_requests_spec.rb b/spec/features/merge_requests/user_views_closed_merge_requests_spec.rb index dc0d35e4fea..abc652c3bbd 100644 --- a/spec/features/merge_requests/user_views_closed_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_views_closed_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views closed merge requests' do +RSpec.describe 'User views closed merge requests' do let!(:closed_merge_request) { create(:closed_merge_request, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:project) { create(:project, :public) } diff --git a/spec/features/merge_requests/user_views_merged_merge_requests_spec.rb b/spec/features/merge_requests/user_views_merged_merge_requests_spec.rb index ddb354204c9..3b93fb7e4bf 100644 --- a/spec/features/merge_requests/user_views_merged_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_views_merged_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views merged merge requests' do +RSpec.describe 'User views merged merge requests' do let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let!(:merged_merge_request) { create(:merged_merge_request, source_project: project, target_project: project) } let(:project) { create(:project, :public) } diff --git a/spec/features/merge_requests/user_views_open_merge_requests_spec.rb b/spec/features/merge_requests/user_views_open_merge_requests_spec.rb index 4aaa20f0455..49509f89a8d 100644 --- a/spec/features/merge_requests/user_views_open_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_views_open_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views open merge requests' do +RSpec.describe 'User views open merge requests' do let_it_be(:user) { create(:user) } shared_examples_for 'shows merge requests' do diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index bfff33f3956..4a7f14d5a1b 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Milestone' do +RSpec.describe 'Milestone' do let(:group) { create(:group, :public) } let(:project) { create(:project, :public, namespace: group) } let(:user) { create(:user) } @@ -111,20 +111,6 @@ describe 'Milestone' do end end - describe 'deprecation popover', :js do - it 'opens deprecation popover' do - milestone = create(:milestone, project: project) - - visit group_milestone_path(group, milestone, title: milestone.title) - - expect(page).to have_selector('.milestone-deprecation-message') - - find('.milestone-deprecation-message .js-popover-link').click - - expect(page).to have_selector('.popover') - end - end - describe 'reopen closed milestones' do before do create(:milestone, :closed, project: project) diff --git a/spec/features/milestones/user_creates_milestone_spec.rb b/spec/features/milestones/user_creates_milestone_spec.rb index 12cb27b0062..d80796b8f9a 100644 --- a/spec/features/milestones/user_creates_milestone_spec.rb +++ b/spec/features/milestones/user_creates_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User creates milestone", :js do +RSpec.describe "User creates milestone", :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/features/milestones/user_deletes_milestone_spec.rb b/spec/features/milestones/user_deletes_milestone_spec.rb index fd72f2dfefa..ede9faed876 100644 --- a/spec/features/milestones/user_deletes_milestone_spec.rb +++ b/spec/features/milestones/user_deletes_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User deletes milestone", :js do +RSpec.describe "User deletes milestone", :js do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } diff --git a/spec/features/milestones/user_edits_milestone_spec.rb b/spec/features/milestones/user_edits_milestone_spec.rb index be05685aff7..3edd50922b6 100644 --- a/spec/features/milestones/user_edits_milestone_spec.rb +++ b/spec/features/milestones/user_edits_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User edits milestone", :js do +RSpec.describe "User edits milestone", :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 5.days.from_now) } diff --git a/spec/features/milestones/user_promotes_milestone_spec.rb b/spec/features/milestones/user_promotes_milestone_spec.rb index d14097e1ef4..a9c3c9706a0 100644 --- a/spec/features/milestones/user_promotes_milestone_spec.rb +++ b/spec/features/milestones/user_promotes_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User promotes milestone' do +RSpec.describe 'User promotes milestone' do let_it_be(:group) { create(:group) } let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: group) } diff --git a/spec/features/milestones/user_sees_breadcrumb_links_spec.rb b/spec/features/milestones/user_sees_breadcrumb_links_spec.rb index 92445735328..e9cfa9b20dc 100644 --- a/spec/features/milestones/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/milestones/user_sees_breadcrumb_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New project milestone breadcrumb' do +RSpec.describe 'New project milestone breadcrumb' do let(:project) { create(:project) } let(:milestone) { create(:milestone, project: project) } let(:user) { project.creator } diff --git a/spec/features/milestones/user_views_milestone_spec.rb b/spec/features/milestones/user_views_milestone_spec.rb index ca13e226432..420f8d49483 100644 --- a/spec/features/milestones/user_views_milestone_spec.rb +++ b/spec/features/milestones/user_views_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User views milestone" do +RSpec.describe "User views milestone" do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/milestones/user_views_milestones_spec.rb b/spec/features/milestones/user_views_milestones_spec.rb index e17797a8165..3f606577121 100644 --- a/spec/features/milestones/user_views_milestones_spec.rb +++ b/spec/features/milestones/user_views_milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "User views milestones" do +RSpec.describe "User views milestones" do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:milestone) { create(:milestone, project: project) } @@ -65,7 +65,7 @@ describe "User views milestones" do end end -describe "User views milestones with no MR" do +RSpec.describe "User views milestones with no MR" do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :merge_requests_disabled) } let_it_be(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/oauth_login_spec.rb b/spec/features/oauth_login_spec.rb index 29e9b0c313a..dc27bfbef50 100644 --- a/spec/features/oauth_login_spec.rb +++ b/spec/features/oauth_login_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'OAuth Login', :js, :allow_forgery_protection do +RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do include DeviseHelpers def enter_code(code) diff --git a/spec/features/oauth_provider_authorize_spec.rb b/spec/features/oauth_provider_authorize_spec.rb index 284fe3b0af9..f5a1a35b66f 100644 --- a/spec/features/oauth_provider_authorize_spec.rb +++ b/spec/features/oauth_provider_authorize_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'OAuth Provider' do +RSpec.describe 'OAuth Provider' do describe 'Standard OAuth Authorization' do let(:application) { create(:oauth_application, scopes: 'read_user') } diff --git a/spec/features/participants_autocomplete_spec.rb b/spec/features/participants_autocomplete_spec.rb index fdedd319116..5c29ac870c0 100644 --- a/spec/features/participants_autocomplete_spec.rb +++ b/spec/features/participants_autocomplete_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Member autocomplete', :js do +RSpec.describe 'Member autocomplete', :js do let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:author) { create(:user) } diff --git a/spec/features/password_reset_spec.rb b/spec/features/password_reset_spec.rb index 8ceca1e3175..31b2b2d15aa 100644 --- a/spec/features/password_reset_spec.rb +++ b/spec/features/password_reset_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Password reset' do +RSpec.describe 'Password reset' do describe 'throttling' do it 'sends reset instructions when not previously sent' do user = create(:user) diff --git a/spec/features/populate_new_pipeline_vars_with_params_spec.rb b/spec/features/populate_new_pipeline_vars_with_params_spec.rb index 5fe80e73e38..f931e8497fc 100644 --- a/spec/features/populate_new_pipeline_vars_with_params_spec.rb +++ b/spec/features/populate_new_pipeline_vars_with_params_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Populate new pipeline CI variables with url params", :js do +RSpec.describe "Populate new pipeline CI variables with url params", :js do let(:user) { create(:user) } let(:project) { create(:project) } let(:page_path) { new_project_pipeline_path(project) } diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index 0147963c0a3..4326700bab1 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile account page', :js do +RSpec.describe 'Profile account page', :js do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index c6db15065f2..620c2f60ba3 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Account', :js do +RSpec.describe 'Profile > Account', :js do let(:user) { create(:user, username: 'foo') } before do @@ -56,6 +56,37 @@ describe 'Profile > Account', :js do end end end + + describe 'Delete account' do + before do + create_list(:project, number_of_projects, namespace: user.namespace) + visit profile_account_path + end + + context 'when there are no personal projects' do + let(:number_of_projects) { 0 } + + it 'does not show personal projects removal message' do + expect(page).not_to have_content(/\d personal projects? will be removed and cannot be restored/) + end + end + + context 'when one personal project exists' do + let(:number_of_projects) { 1 } + + it 'does show personal project removal message' do + expect(page).to have_content('1 personal project will be removed and cannot be restored') + end + end + + context 'when more than one personal projects exists' do + let(:number_of_projects) { 3 } + + it 'shows pluralized personal project removal message' do + expect(page).to have_content('3 personal projects will be removed and cannot be restored') + end + end + end end def update_username(new_username) diff --git a/spec/features/profiles/active_sessions_spec.rb b/spec/features/profiles/active_sessions_spec.rb index 8f63ce2a197..75531d43df2 100644 --- a/spec/features/profiles/active_sessions_spec.rb +++ b/spec/features/profiles/active_sessions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do +RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do let(:user) do create(:user).tap do |user| user.current_sign_in_at = Time.current diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index 4c447faf77e..80b36aa37b8 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Chat' do +RSpec.describe 'Profile > Chat' do let(:user) { create(:user) } let(:service) { create(:service) } diff --git a/spec/features/profiles/emails_spec.rb b/spec/features/profiles/emails_spec.rb index a41ef9e86ae..fc7de6d8b23 100644 --- a/spec/features/profiles/emails_spec.rb +++ b/spec/features/profiles/emails_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Emails' do +RSpec.describe 'Profile > Emails' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/gpg_keys_spec.rb b/spec/features/profiles/gpg_keys_spec.rb index 07e87f36c65..18ed4e646b3 100644 --- a/spec/features/profiles/gpg_keys_spec.rb +++ b/spec/features/profiles/gpg_keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > GPG Keys' do +RSpec.describe 'Profile > GPG Keys' do let(:user) { create(:user, email: GpgHelpers::User2.emails.first) } before do diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 3fc0fd76d2e..b5e784a749f 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > SSH Keys' do +RSpec.describe 'Profile > SSH Keys' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb index 94c9897a7a9..2735f601307 100644 --- a/spec/features/profiles/oauth_applications_spec.rb +++ b/spec/features/profiles/oauth_applications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Applications' do +RSpec.describe 'Profile > Applications' do let(:user) { create(:user) } let(:application) { create(:oauth_application, owner: user) } diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 9dc96080732..a274f2b6d96 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Password' do +RSpec.describe 'Profile > Password' do let(:user) { create(:user) } def fill_passwords(password, confirmation) diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 1fb61eeeb5a..21a0d01a9bf 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Personal Access Tokens', :js do +RSpec.describe 'Profile > Personal Access Tokens', :js do let(:user) { create(:user) } def active_personal_access_tokens diff --git a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb index 5af48c4503d..a5b7b1fba9d 100644 --- a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb +++ b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Profile > Notifications > User changes notified_of_own_activity setting', :js do +RSpec.describe 'Profile > Notifications > User changes notified_of_own_activity setting', :js do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_edit_preferences_spec.rb b/spec/features/profiles/user_edit_preferences_spec.rb index 6e61536d5ff..e1117d2d420 100644 --- a/spec/features/profiles/user_edit_preferences_spec.rb +++ b/spec/features/profiles/user_edit_preferences_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe 'User edit preferences profile' do +RSpec.describe 'User edit preferences profile' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 171dfb353f0..2659157d61d 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User edit profile' do +RSpec.describe 'User edit profile' do let(:user) { create(:user) } before do @@ -245,6 +245,15 @@ describe 'User edit profile' do end end + it 'opens the emoji modal again after closing it' do + open_user_status_modal + select_emoji('biohazard', true) + + find('.js-toggle-emoji-menu').click + + expect(page).to have_selector('.emoji-menu') + end + it 'does not update the awards panel emoji' do project.add_maintainer(user) visit(project_issue_path(project, issue)) diff --git a/spec/features/profiles/user_manages_applications_spec.rb b/spec/features/profiles/user_manages_applications_spec.rb index 668c4e8c784..d65365db880 100644 --- a/spec/features/profiles/user_manages_applications_spec.rb +++ b/spec/features/profiles/user_manages_applications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User manages applications' do +RSpec.describe 'User manages applications' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_manages_emails_spec.rb b/spec/features/profiles/user_manages_emails_spec.rb index 09da819a187..373c4f565f2 100644 --- a/spec/features/profiles/user_manages_emails_spec.rb +++ b/spec/features/profiles/user_manages_emails_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User manages emails' do +RSpec.describe 'User manages emails' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb index d788c0574e2..997cc8e3c4b 100644 --- a/spec/features/profiles/user_visits_notifications_tab_spec.rb +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits the notifications tab', :js do +RSpec.describe 'User visits the notifications tab', :js do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/profiles/user_visits_profile_account_page_spec.rb b/spec/features/profiles/user_visits_profile_account_page_spec.rb index f576a2bf9e1..b4d1185412b 100644 --- a/spec/features/profiles/user_visits_profile_account_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_account_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits the profile account page' do +RSpec.describe 'User visits the profile account page' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_visits_profile_authentication_log_spec.rb b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb index 2f6f8ebee9c..22292eff9a3 100644 --- a/spec/features/profiles/user_visits_profile_authentication_log_spec.rb +++ b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits the authentication log' do +RSpec.describe 'User visits the authentication log' do let(:user) { create(:user) } context 'when user signed in' do diff --git a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb index b18f763a968..d9421631b32 100644 --- a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits the profile preferences page' do +RSpec.describe 'User visits the profile preferences page' do include Select2Helper let(:user) { create(:user) } diff --git a/spec/features/profiles/user_visits_profile_spec.rb b/spec/features/profiles/user_visits_profile_spec.rb index 1c90a794099..77da1f138c7 100644 --- a/spec/features/profiles/user_visits_profile_spec.rb +++ b/spec/features/profiles/user_visits_profile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits their profile' do +RSpec.describe 'User visits their profile' do let(:user) { create(:user) } before do diff --git a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb index 05ad9096f65..0531434f00c 100644 --- a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User visits the profile SSH keys page' do +RSpec.describe 'User visits the profile SSH keys page' do let(:user) { create(:user) } before do diff --git a/spec/features/project_group_variables_spec.rb b/spec/features/project_group_variables_spec.rb index 242fc993718..e964a7def14 100644 --- a/spec/features/project_group_variables_spec.rb +++ b/spec/features/project_group_variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project group variables', :js do +RSpec.describe 'Project group variables', :js do let(:user) { create(:user) } let(:group) { create(:group) } let(:subgroup) { create(:group, parent: group) } diff --git a/spec/features/project_variables_spec.rb b/spec/features/project_variables_spec.rb index 1452317c22b..c67bcbf919b 100644 --- a/spec/features/project_variables_spec.rb +++ b/spec/features/project_variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project variables', :js do +RSpec.describe 'Project variables', :js do let(:user) { create(:user) } let(:project) { create(:project) } let(:variable) { create(:ci_variable, key: 'test_key', value: 'test_value', masked: true) } diff --git a/spec/features/projects/active_tabs_spec.rb b/spec/features/projects/active_tabs_spec.rb index 815cf3b9c58..349e5f5e177 100644 --- a/spec/features/projects/active_tabs_spec.rb +++ b/spec/features/projects/active_tabs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project active tab' do +RSpec.describe 'Project active tab' do let(:user) { create :user } let(:project) { create(:project, :repository) } @@ -84,7 +84,7 @@ describe 'Project active tab' do context 'on project Wiki' do before do - visit project_wiki_path(project, :home) + visit wiki_path(project.wiki) end it_behaves_like 'page has active tab', 'Wiki' diff --git a/spec/features/projects/activity/rss_spec.rb b/spec/features/projects/activity/rss_spec.rb index e1efe6ca64d..9012b335bf4 100644 --- a/spec/features/projects/activity/rss_spec.rb +++ b/spec/features/projects/activity/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Activity RSS' do +RSpec.describe 'Project Activity RSS' do let(:project) { create(:project, :public) } let(:user) { project.owner } let(:path) { activity_project_path(project) } diff --git a/spec/features/projects/activity/user_sees_activity_spec.rb b/spec/features/projects/activity/user_sees_activity_spec.rb index 664002d909c..a9cdbd5c342 100644 --- a/spec/features/projects/activity/user_sees_activity_spec.rb +++ b/spec/features/projects/activity/user_sees_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Activity > User sees activity' do +RSpec.describe 'Projects > Activity > User sees activity' do let(:project) { create(:project, :repository, :public) } let(:user) { project.creator } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/projects/activity/user_sees_design_comment_spec.rb b/spec/features/projects/activity/user_sees_design_comment_spec.rb index 9864e9ce29f..e60deba65f0 100644 --- a/spec/features/projects/activity/user_sees_design_comment_spec.rb +++ b/spec/features/projects/activity/user_sees_design_comment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Activity > User sees design comment', :js do +RSpec.describe 'Projects > Activity > User sees design comment', :js do include DesignManagementTestHelpers let_it_be(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/activity/user_sees_private_activity_spec.rb b/spec/features/projects/activity/user_sees_private_activity_spec.rb index 0ec4752d418..86692bc6b4c 100644 --- a/spec/features/projects/activity/user_sees_private_activity_spec.rb +++ b/spec/features/projects/activity/user_sees_private_activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Activity > User sees private activity', :js do +RSpec.describe 'Project > Activity > User sees private activity', :js do let(:project) { create(:project, :public) } let(:author) { create(:user) } let(:user) { create(:user) } diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb index f7eaae12072..b61ee623fec 100644 --- a/spec/features/projects/artifacts/file_spec.rb +++ b/spec/features/projects/artifacts/file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Artifact file', :js do +RSpec.describe 'Artifact file', :js do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/raw_spec.rb b/spec/features/projects/artifacts/raw_spec.rb index 0606ab0ed08..d72a35fddf8 100644 --- a/spec/features/projects/artifacts/raw_spec.rb +++ b/spec/features/projects/artifacts/raw_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Raw artifact', :js do +RSpec.describe 'Raw artifact', :js do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb index d8c6ef4755d..77e3c7f972d 100644 --- a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User browses artifacts" do +RSpec.describe "User browses artifacts" do let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb index 78ff89799ad..7d6ae03e08e 100644 --- a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User downloads artifacts" do +RSpec.describe "User downloads artifacts" do let_it_be(:project) { create(:project, :repository, :public) } let_it_be(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) } let_it_be(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb index d17588bb7b4..4c144037acd 100644 --- a/spec/features/projects/badges/coverage_spec.rb +++ b/spec/features/projects/badges/coverage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'test coverage badge' do +RSpec.describe 'test coverage badge' do let!(:user) { create(:user) } let!(:project) { create(:project, :private) } diff --git a/spec/features/projects/badges/list_spec.rb b/spec/features/projects/badges/list_spec.rb index 7a90457c942..3382bdcd65f 100644 --- a/spec/features/projects/badges/list_spec.rb +++ b/spec/features/projects/badges/list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'list of badges' do +RSpec.describe 'list of badges' do before do user = create(:user) project = create(:project, :repository) diff --git a/spec/features/projects/badges/pipeline_badge_spec.rb b/spec/features/projects/badges/pipeline_badge_spec.rb index b2f09a9d0b7..c24ab5c4058 100644 --- a/spec/features/projects/badges/pipeline_badge_spec.rb +++ b/spec/features/projects/badges/pipeline_badge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Pipeline Badge' do +RSpec.describe 'Pipeline Badge' do let_it_be(:project) { create(:project, :repository, :public) } let(:ref) { project.default_branch } diff --git a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb index e54137b9492..6bd6634822c 100644 --- a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb +++ b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js do +RSpec.describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js do include TreeHelper let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb index 9fc70412975..c738c5ee5fa 100644 --- a/spec/features/projects/blobs/blob_show_spec.rb +++ b/spec/features/projects/blobs/blob_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'File blob', :js do +RSpec.describe 'File blob', :js do include MobileHelpers let(:project) { create(:project, :public, :repository) } @@ -555,6 +555,53 @@ describe 'File blob', :js do end end + describe '.gitlab/dashboards/custom-dashboard.yml' do + before do + project.add_maintainer(project.creator) + + Files::CreateService.new( + project, + project.creator, + start_branch: 'master', + branch_name: 'master', + commit_message: "Add .gitlab/dashboards/custom-dashboard.yml", + file_path: '.gitlab/dashboards/custom-dashboard.yml', + file_content: file_content + ).execute + + visit_blob('.gitlab/dashboards/custom-dashboard.yml') + end + + context 'valid dashboard file' do + let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is valid + expect(page).to have_content('Metrics Dashboard YAML definition is valid.') + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + + context 'invalid dashboard file' do + let(:file_content) { "dashboard: 'invalid'" } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is invalid + expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') + expect(page).to have_content("panel_groups: can't be blank") + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + end + context 'LICENSE' do before do visit_blob('LICENSE') diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index 5d62b2f87bb..56bf31f24ba 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Editing file blob', :js do +RSpec.describe 'Editing file blob', :js do include TreeHelper let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/projects/blobs/shortcuts_blob_spec.rb b/spec/features/projects/blobs/shortcuts_blob_spec.rb index bc12a8ff007..64d643aa102 100644 --- a/spec/features/projects/blobs/shortcuts_blob_spec.rb +++ b/spec/features/projects/blobs/shortcuts_blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Blob shortcuts', :js do +RSpec.describe 'Blob shortcuts', :js do include TreeHelper let(:project) { create(:project, :public, :repository) } let(:path) { project.repository.ls_files(project.repository.root_ref)[0] } diff --git a/spec/features/projects/blobs/user_creates_new_blob_in_new_project_spec.rb b/spec/features/projects/blobs/user_creates_new_blob_in_new_project_spec.rb index 30878b7fb64..f54bceec2b3 100644 --- a/spec/features/projects/blobs/user_creates_new_blob_in_new_project_spec.rb +++ b/spec/features/projects/blobs/user_creates_new_blob_in_new_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User creates blob in new project', :js do +RSpec.describe 'User creates blob in new project', :js do let(:user) { create(:user) } let(:project) { create(:project, :empty_repo) } diff --git a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb index 09130d34281..5270774b541 100644 --- a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb +++ b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User follows pipeline suggest nudge spec when feature is enabled', :js do +RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js do include CookieHelper let(:user) { create(:user, :admin) } diff --git a/spec/features/projects/branches/download_buttons_spec.rb b/spec/features/projects/branches/download_buttons_spec.rb index e0b0e22823e..569a93a55fc 100644 --- a/spec/features/projects/branches/download_buttons_spec.rb +++ b/spec/features/projects/branches/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Download buttons in branches page' do +RSpec.describe 'Download buttons in branches page' do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb index 4b6b07f6cda..5f58e446ed9 100644 --- a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb +++ b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New Branch Ref Dropdown', :js do +RSpec.describe 'New Branch Ref Dropdown', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } let(:toggle) { find('.create-from .dropdown-menu-toggle') } diff --git a/spec/features/projects/branches/user_creates_branch_spec.rb b/spec/features/projects/branches/user_creates_branch_spec.rb index 8aac188160b..52c860bfe36 100644 --- a/spec/features/projects/branches/user_creates_branch_spec.rb +++ b/spec/features/projects/branches/user_creates_branch_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User creates branch", :js do +RSpec.describe "User creates branch", :js do include Spec::Support::Helpers::Features::BranchesHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/branches/user_deletes_branch_spec.rb b/spec/features/projects/branches/user_deletes_branch_spec.rb index 184954c1c78..21a1d31bad4 100644 --- a/spec/features/projects/branches/user_deletes_branch_spec.rb +++ b/spec/features/projects/branches/user_deletes_branch_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User deletes branch", :js do +RSpec.describe "User deletes branch", :js do let_it_be(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/branches/user_views_branches_spec.rb b/spec/features/projects/branches/user_views_branches_spec.rb index e127e784b94..19d96579785 100644 --- a/spec/features/projects/branches/user_views_branches_spec.rb +++ b/spec/features/projects/branches/user_views_branches_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User views branches" do +RSpec.describe "User views branches" do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { project.owner } diff --git a/spec/features/projects/branches_spec.rb b/spec/features/projects/branches_spec.rb index 9dc0f7c90c2..dbd1cebd515 100644 --- a/spec/features/projects/branches_spec.rb +++ b/spec/features/projects/branches_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Branches' do +RSpec.describe 'Branches' do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } let(:repository) { project.repository } @@ -231,6 +231,44 @@ describe 'Branches' do end end + context 'with one or more pipeline', :js do + before do + sha = create_file(branch_name: "branch") + create(:ci_pipeline, + project: project, + user: user, + ref: "branch", + sha: sha, + status: :success, + created_at: 5.months.ago) + visit project_branches_path(project) + end + + it 'shows pipeline status when available' do + page.within first('.all-branches li') do + expect(page).to have_css 'a.ci-status-icon-success' + end + end + + it 'displays a placeholder when not available' do + page.all('.all-branches li') do |li| + expect(li).to have_css 'svg.s24' + end + end + end + + context 'with no pipelines', :js do + before do + visit project_branches_path(project) + end + + it 'does not show placeholder or pipeline status' do + page.all('.all-branches') do |branches| + expect(branches).not_to have_css 'svg.s24' + end + end + end + describe 'comparing branches' do before do sign_in(user) diff --git a/spec/features/projects/ci/lint_spec.rb b/spec/features/projects/ci/lint_spec.rb index 521cfb54cd2..f3845bb8dec 100644 --- a/spec/features/projects/ci/lint_spec.rb +++ b/spec/features/projects/ci/lint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CI Lint', :js do +RSpec.describe 'CI Lint', :js do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/classification_label_on_project_pages_spec.rb b/spec/features/projects/classification_label_on_project_pages_spec.rb index 92f8aa8eb8d..0f07ca7635b 100644 --- a/spec/features/projects/classification_label_on_project_pages_spec.rb +++ b/spec/features/projects/classification_label_on_project_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Classification label on project pages' do +RSpec.describe 'Classification label on project pages' do let(:project) do create(:project, external_authorization_classification_label: 'authorized label') end diff --git a/spec/features/projects/clusters/applications_spec.rb b/spec/features/projects/clusters/applications_spec.rb index ce971b158a3..74b477dd85d 100644 --- a/spec/features/projects/clusters/applications_spec.rb +++ b/spec/features/projects/clusters/applications_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative '../../../../spec/features/clusters/installing_applications_shared_examples' -describe 'Project-level Cluster Applications', :js do +RSpec.describe 'Project-level Cluster Applications', :js do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/clusters/eks_spec.rb b/spec/features/projects/clusters/eks_spec.rb index a856376cb4b..c5feef6c6f3 100644 --- a/spec/features/projects/clusters/eks_spec.rb +++ b/spec/features/projects/clusters/eks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'AWS EKS Cluster', :js do +RSpec.describe 'AWS EKS Cluster', :js do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index b35e79bef43..3e1006920e7 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Gcp Cluster', :js, :do_not_mock_admin_mode do +RSpec.describe 'Gcp Cluster', :js, :do_not_mock_admin_mode do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb index 5c82d848563..15fed0c2727 100644 --- a/spec/features/projects/clusters/user_spec.rb +++ b/spec/features/projects/clusters/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User Cluster', :js do +RSpec.describe 'User Cluster', :js do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb index fc2de4df5ec..1cf214a5c4e 100644 --- a/spec/features/projects/clusters_spec.rb +++ b/spec/features/projects/clusters_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Clusters', :js do +RSpec.describe 'Clusters', :js do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index d28ff5d3b5f..13f73b8cf44 100644 --- a/spec/features/projects/commit/builds_spec.rb +++ b/spec/features/projects/commit/builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'project commit pipelines', :js do +RSpec.describe 'project commit pipelines', :js do let(:project) { create(:project, :repository) } before do diff --git a/spec/features/projects/commit/cherry_pick_spec.rb b/spec/features/projects/commit/cherry_pick_spec.rb index 34b15aeaa25..9fe3f4cd63e 100644 --- a/spec/features/projects/commit/cherry_pick_spec.rb +++ b/spec/features/projects/commit/cherry_pick_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Cherry-pick Commits' do +RSpec.describe 'Cherry-pick Commits' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } diff --git a/spec/features/projects/commit/comments/user_adds_comment_spec.rb b/spec/features/projects/commit/comments/user_adds_comment_spec.rb index bae8e6dc827..a470215186b 100644 --- a/spec/features/projects/commit/comments/user_adds_comment_spec.rb +++ b/spec/features/projects/commit/comments/user_adds_comment_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User adds a comment on a commit", :js do +RSpec.describe "User adds a comment on a commit", :js do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/comments/user_deletes_comments_spec.rb b/spec/features/projects/commit/comments/user_deletes_comments_spec.rb index 2993a402e37..431cbb4ffbb 100644 --- a/spec/features/projects/commit/comments/user_deletes_comments_spec.rb +++ b/spec/features/projects/commit/comments/user_deletes_comments_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User deletes comments on a commit", :js do +RSpec.describe "User deletes comments on a commit", :js do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/comments/user_edits_comments_spec.rb b/spec/features/projects/commit/comments/user_edits_comments_spec.rb index 29132173674..787d8cdb02b 100644 --- a/spec/features/projects/commit/comments/user_edits_comments_spec.rb +++ b/spec/features/projects/commit/comments/user_edits_comments_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User edits a comment on a commit", :js do +RSpec.describe "User edits a comment on a commit", :js do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/diff_notes_spec.rb b/spec/features/projects/commit/diff_notes_spec.rb index 04bd66df28d..ff86047d812 100644 --- a/spec/features/projects/commit/diff_notes_spec.rb +++ b/spec/features/projects/commit/diff_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Commit diff', :js do +RSpec.describe 'Commit diff', :js do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/commit/mini_pipeline_graph_spec.rb b/spec/features/projects/commit/mini_pipeline_graph_spec.rb index 3d9fcfe0f62..9349f36282d 100644 --- a/spec/features/projects/commit/mini_pipeline_graph_spec.rb +++ b/spec/features/projects/commit/mini_pipeline_graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Mini Pipeline Graph in Commit View', :js do +RSpec.describe 'Mini Pipeline Graph in Commit View', :js do let(:project) { create(:project, :public, :repository) } context 'when commit has pipelines' do diff --git a/spec/features/projects/commit/user_comments_on_commit_spec.rb b/spec/features/projects/commit/user_comments_on_commit_spec.rb index f4fea9b9ae0..87a022d74a3 100644 --- a/spec/features/projects/commit/user_comments_on_commit_spec.rb +++ b/spec/features/projects/commit/user_comments_on_commit_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User comments on commit", :js do +RSpec.describe "User comments on commit", :js do include Spec::Support::Helpers::Features::NotesHelpers include RepoHelpers diff --git a/spec/features/projects/commit/user_reverts_commit_spec.rb b/spec/features/projects/commit/user_reverts_commit_spec.rb index 39ee72a4a99..ca4e070703b 100644 --- a/spec/features/projects/commit/user_reverts_commit_spec.rb +++ b/spec/features/projects/commit/user_reverts_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User reverts a commit', :js do +RSpec.describe 'User reverts a commit', :js do include RepoHelpers let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb index c07f6081d2c..71405cf917d 100644 --- a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb +++ b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Commit > View user status' do +RSpec.describe 'Project > Commit > View user status' do include RepoHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/projects/commits/rss_spec.rb b/spec/features/projects/commits/rss_spec.rb index 0266df48d4a..b521bb865ae 100644 --- a/spec/features/projects/commits/rss_spec.rb +++ b/spec/features/projects/commits/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Commits RSS' do +RSpec.describe 'Project Commits RSS' do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_commits_path(project, :master) } diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 7e59e36ccb7..2796156bfbf 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User browses commits' do +RSpec.describe 'User browses commits' do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb index df5cec80ae4..865ae3ad8cb 100644 --- a/spec/features/projects/compare_spec.rb +++ b/spec/features/projects/compare_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "Compare", :js do +RSpec.describe "Compare", :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/container_registry_spec.rb b/spec/features/projects/container_registry_spec.rb index a75da5f1080..f561149d2ad 100644 --- a/spec/features/projects/container_registry_spec.rb +++ b/spec/features/projects/container_registry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Container Registry', :js do +RSpec.describe 'Container Registry', :js do let(:user) { create(:user) } let(:project) { create(:project) } @@ -30,10 +30,10 @@ describe 'Container Registry', :js do expect(page).to have_content _('There are no container images stored for this project') end - it 'list page has quickstart' do + it 'list page has cli commands' do visit_container_registry - expect(page).to have_content _('Quick Start') + expect(page).to have_content _('CLI Commands') end end @@ -84,7 +84,7 @@ describe 'Container Registry', :js do expect(service).to receive(:execute).with(container_repository) { { status: :success } } expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(container_repository.project, user, tags: ['1']) { service } - first('.js-delete-registry').click + first('[data-testid="singleDeleteButton"]').click expect(find('.modal .modal-title')).to have_content _('Remove tag') find('.modal .modal-footer .btn-danger').click end diff --git a/spec/features/projects/deploy_keys_spec.rb b/spec/features/projects/deploy_keys_spec.rb index 687b6461f05..70d47516246 100644 --- a/spec/features/projects/deploy_keys_spec.rb +++ b/spec/features/projects/deploy_keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project deploy keys', :js do +RSpec.describe 'Project deploy keys', :js do let(:user) { create(:user) } let(:project) { create(:project_empty_repo) } diff --git a/spec/features/projects/diffs/diff_show_spec.rb b/spec/features/projects/diffs/diff_show_spec.rb index df94d6debd6..19f111a727b 100644 --- a/spec/features/projects/diffs/diff_show_spec.rb +++ b/spec/features/projects/diffs/diff_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Diff file viewer', :js do +RSpec.describe 'Diff file viewer', :js do let(:project) { create(:project, :public, :repository) } def visit_commit(sha, anchor: nil) diff --git a/spec/features/projects/environments/environment_metrics_spec.rb b/spec/features/projects/environments/environment_metrics_spec.rb index 150df66bdd7..a3b979d0f42 100644 --- a/spec/features/projects/environments/environment_metrics_spec.rb +++ b/spec/features/projects/environments/environment_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Environment > Metrics' do +RSpec.describe 'Environment > Metrics' do include PrometheusHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index bbd33225bb9..fa10e429af2 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Environment' do +RSpec.describe 'Environment' do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index cee9b6d50ba..b3f671d57a9 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Environments page', :js do +RSpec.describe 'Environments page', :js do let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/environments_pod_logs_spec.rb b/spec/features/projects/environments_pod_logs_spec.rb index 32eaf690950..82dafbc6237 100644 --- a/spec/features/projects/environments_pod_logs_spec.rb +++ b/spec/features/projects/environments_pod_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Environment > Pod Logs', :js, :kubeclient do +RSpec.describe 'Environment > Pod Logs', :js, :kubeclient do include KubernetesHelpers let(:pod_names) { %w(kube-pod) } diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index 9854335a7ad..d84c39de8d8 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Edit Project Settings' do +RSpec.describe 'Edit Project Settings' do let(:member) { create(:user) } let!(:project) { create(:project, :public, :repository) } let!(:issue) { create(:issue, project: project) } @@ -94,7 +94,7 @@ describe 'Edit Project Settings' do { builds: project_job_path(project, job), issues: project_issues_path(project), - wiki: project_wiki_path(project, :home), + wiki: wiki_path(project.wiki), snippets: project_snippets_path(project), merge_requests: project_merge_requests_path(project) } diff --git a/spec/features/projects/files/dockerfile_dropdown_spec.rb b/spec/features/projects/files/dockerfile_dropdown_spec.rb index 756f2f2d493..a99df8a79d8 100644 --- a/spec/features/projects/files/dockerfile_dropdown_spec.rb +++ b/spec/features/projects/files/dockerfile_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User wants to add a Dockerfile file' do +RSpec.describe 'Projects > Files > User wants to add a Dockerfile file' do before do project = create(:project, :repository) sign_in project.owner diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb index 871f5212ddd..a486d7517ac 100644 --- a/spec/features/projects/files/download_buttons_spec.rb +++ b/spec/features/projects/files/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Download buttons in files tree' do +RSpec.describe 'Projects > Files > Download buttons in files tree' do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb index 53b1a522a8e..ede22204dbd 100644 --- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb +++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User uses soft wrap while editing file', :js do +RSpec.describe 'Projects > Files > User uses soft wrap while editing file', :js do before do project = create(:project, :repository) user = project.owner diff --git a/spec/features/projects/files/editing_a_file_spec.rb b/spec/features/projects/files/editing_a_file_spec.rb index 085276f96a8..819864b3def 100644 --- a/spec/features/projects/files/editing_a_file_spec.rb +++ b/spec/features/projects/files/editing_a_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User wants to edit a file' do +RSpec.describe 'Projects > Files > User wants to edit a file' do let(:project) { create(:project, :repository) } let(:user) { project.owner } let(:commit_params) do diff --git a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb index 622764487d8..94190889ace 100644 --- a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb +++ b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User views files page' do +RSpec.describe 'Projects > Files > User views files page' do let(:project) { create(:forked_project_with_submodules) } let(:user) { project.owner } diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb index b680be09444..4293183fd9a 100644 --- a/spec/features/projects/files/find_file_keyboard_spec.rb +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Find file keyboard shortcuts', :js do +RSpec.describe 'Projects > Files > Find file keyboard shortcuts', :js do let(:project) { create(:project, :repository) } let(:user) { project.owner } diff --git a/spec/features/projects/files/gitignore_dropdown_spec.rb b/spec/features/projects/files/gitignore_dropdown_spec.rb index a8c6e780d47..dae1164f7f2 100644 --- a/spec/features/projects/files/gitignore_dropdown_spec.rb +++ b/spec/features/projects/files/gitignore_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User wants to add a .gitignore file' do +RSpec.describe 'Projects > Files > User wants to add a .gitignore file' do before do project = create(:project, :repository) sign_in project.owner diff --git a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb index 107d426a893..879cb6a65c8 100644 --- a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb +++ b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do +RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do before do project = create(:project, :repository) sign_in project.owner diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index 9fccb3441d6..ab62e8aabc0 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Project owner creates a license file', :js do +RSpec.describe 'Projects > Files > Project owner creates a license file', :js do let(:project) { create(:project, :repository) } let(:project_maintainer) { project.owner } diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index ad6c565c8f9..eed1e7aaf1b 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Project owner sees a link to create a license file in empty project', :js do +RSpec.describe 'Projects > Files > Project owner sees a link to create a license file in empty project', :js do let(:project) { create(:project_empty_repo) } let(:project_maintainer) { project.owner } diff --git a/spec/features/projects/files/template_selector_menu_spec.rb b/spec/features/projects/files/template_selector_menu_spec.rb index 838a484d62e..51ae6616d4a 100644 --- a/spec/features/projects/files/template_selector_menu_spec.rb +++ b/spec/features/projects/files/template_selector_menu_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Template selector menu', :js do +RSpec.describe 'Template selector menu', :js do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/files/template_type_dropdown_spec.rb b/spec/features/projects/files/template_type_dropdown_spec.rb index 5ea0b9b015f..ca9ce841a92 100644 --- a/spec/features/projects/files/template_type_dropdown_spec.rb +++ b/spec/features/projects/files/template_type_dropdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Template type dropdown selector', :js do +RSpec.describe 'Projects > Files > Template type dropdown selector', :js do let(:project) { create(:project, :repository) } let(:user) { project.owner } diff --git a/spec/features/projects/files/undo_template_spec.rb b/spec/features/projects/files/undo_template_spec.rb index 887214e1dbf..09ae595490a 100644 --- a/spec/features/projects/files/undo_template_spec.rb +++ b/spec/features/projects/files/undo_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > Template Undo Button', :js do +RSpec.describe 'Projects > Files > Template Undo Button', :js do let(:project) { create(:project, :repository) } let(:user) { project.owner } diff --git a/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb b/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb index e88fad9d3f7..4d9da783f98 100644 --- a/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb +++ b/spec/features/projects/files/user_browses_a_tree_with_a_folder_containing_only_a_folder_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' # This is a regression test for https://gitlab.com/gitlab-org/gitlab-foss/issues/37569 -describe 'Projects > Files > User browses a tree with a folder containing only a folder', :js do +RSpec.describe 'Projects > Files > User browses a tree with a folder containing only a folder', :js do let(:project) { create(:project, :empty_repo) } let(:user) { project.owner } diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 7e3d8e5c1c5..44b5833a8c8 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User browses files" do +RSpec.describe "User browses files" do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_browses_lfs_files_spec.rb b/spec/features/projects/files/user_browses_lfs_files_spec.rb index dbeec973865..ecc56b794b2 100644 --- a/spec/features/projects/files/user_browses_lfs_files_spec.rb +++ b/spec/features/projects/files/user_browses_lfs_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User browses LFS files' do +RSpec.describe 'Projects > Files > User browses LFS files' do let(:project) { create(:project, :repository) } let(:user) { project.owner } diff --git a/spec/features/projects/files/user_creates_directory_spec.rb b/spec/features/projects/files/user_creates_directory_spec.rb index 4291f0a74f8..47c5d667f4f 100644 --- a/spec/features/projects/files/user_creates_directory_spec.rb +++ b/spec/features/projects/files/user_creates_directory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User creates a directory', :js do +RSpec.describe 'Projects > Files > User creates a directory', :js do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb index 2d4f22e299e..7d412730115 100644 --- a/spec/features/projects/files/user_creates_files_spec.rb +++ b/spec/features/projects/files/user_creates_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User creates files', :js do +RSpec.describe 'Projects > Files > User creates files', :js do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_deletes_files_spec.rb b/spec/features/projects/files/user_deletes_files_spec.rb index 5e36407d9cb..70f125560e0 100644 --- a/spec/features/projects/files/user_deletes_files_spec.rb +++ b/spec/features/projects/files/user_deletes_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User deletes files', :js do +RSpec.describe 'Projects > Files > User deletes files', :js do let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." diff --git a/spec/features/projects/files/user_edits_files_spec.rb b/spec/features/projects/files/user_edits_files_spec.rb index cc428dce2a8..1bb931e35ec 100644 --- a/spec/features/projects/files/user_edits_files_spec.rb +++ b/spec/features/projects/files/user_edits_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User edits files', :js do +RSpec.describe 'Projects > Files > User edits files', :js do include ProjectForksHelper let(:project) { create(:project, :repository, name: 'Shop') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } diff --git a/spec/features/projects/files/user_find_file_spec.rb b/spec/features/projects/files/user_find_file_spec.rb index 72f6ccb20d6..69ea8b0eb5f 100644 --- a/spec/features/projects/files/user_find_file_spec.rb +++ b/spec/features/projects/files/user_find_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User find project file' do +RSpec.describe 'User find project file' do let(:user) { create :user } let(:project) { create :project, :repository } diff --git a/spec/features/projects/files/user_reads_pipeline_status_spec.rb b/spec/features/projects/files/user_reads_pipeline_status_spec.rb index 9d38c44b6ef..294a03813cd 100644 --- a/spec/features/projects/files/user_reads_pipeline_status_spec.rb +++ b/spec/features/projects/files/user_reads_pipeline_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'user reads pipeline status', :js do +RSpec.describe 'user reads pipeline status', :js do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:v110_pipeline) { create_pipeline('v1.1.0', 'success') } diff --git a/spec/features/projects/files/user_replaces_files_spec.rb b/spec/features/projects/files/user_replaces_files_spec.rb index e1eefdcc40f..1d4085ef21c 100644 --- a/spec/features/projects/files/user_replaces_files_spec.rb +++ b/spec/features/projects/files/user_replaces_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User replaces files', :js do +RSpec.describe 'Projects > Files > User replaces files', :js do include DropzoneHelper let(:fork_message) do diff --git a/spec/features/projects/files/user_searches_for_files_spec.rb b/spec/features/projects/files/user_searches_for_files_spec.rb index ff7547bce83..7fd7dfff279 100644 --- a/spec/features/projects/files/user_searches_for_files_spec.rb +++ b/spec/features/projects/files/user_searches_for_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User searches for files' do +RSpec.describe 'Projects > Files > User searches for files' do let(:user) { project.owner } before do diff --git a/spec/features/projects/files/user_uploads_files_spec.rb b/spec/features/projects/files/user_uploads_files_spec.rb index ecf40969541..944d08df3f3 100644 --- a/spec/features/projects/files/user_uploads_files_spec.rb +++ b/spec/features/projects/files/user_uploads_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Files > User uploads files' do +RSpec.describe 'Projects > Files > User uploads files' do include DropzoneHelper let(:user) { create(:user) } diff --git a/spec/features/projects/fork_spec.rb b/spec/features/projects/fork_spec.rb index bfab4387688..f0ed4013230 100644 --- a/spec/features/projects/fork_spec.rb +++ b/spec/features/projects/fork_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project fork' do +RSpec.describe 'Project fork' do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/forks/fork_list_spec.rb b/spec/features/projects/forks/fork_list_spec.rb index 3b63d9a4c2d..b48c46ef8cb 100644 --- a/spec/features/projects/forks/fork_list_spec.rb +++ b/spec/features/projects/forks/fork_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'listing forks of a project' do +RSpec.describe 'listing forks of a project' do include ProjectForksHelper include ExternalAuthorizationServiceHelpers diff --git a/spec/features/projects/gfm_autocomplete_load_spec.rb b/spec/features/projects/gfm_autocomplete_load_spec.rb index ad39dec0a43..b02483be489 100644 --- a/spec/features/projects/gfm_autocomplete_load_spec.rb +++ b/spec/features/projects/gfm_autocomplete_load_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'GFM autocomplete loading', :js do +RSpec.describe 'GFM autocomplete loading', :js do let(:project) { create(:project) } before do diff --git a/spec/features/projects/graph_spec.rb b/spec/features/projects/graph_spec.rb index 25efb7b28a7..7b9f79c9f7f 100644 --- a/spec/features/projects/graph_spec.rb +++ b/spec/features/projects/graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Graph', :js do +RSpec.describe 'Project Graph', :js do let(:user) { create :user } let(:project) { create(:project, :repository, namespace: user.namespace) } let(:branch_name) { 'master' } diff --git a/spec/features/projects/hook_logs/user_reads_log_spec.rb b/spec/features/projects/hook_logs/user_reads_log_spec.rb index 8c666f5d67a..8513a9374d1 100644 --- a/spec/features/projects/hook_logs/user_reads_log_spec.rb +++ b/spec/features/projects/hook_logs/user_reads_log_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Hook logs' do +RSpec.describe 'Hook logs' do let(:web_hook_log) { create(:web_hook_log, response_body: '<script>') } let(:project) { web_hook_log.web_hook.project } let(:user) { create(:user) } diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb index 1d6d5ae1b4d..86aeb2bc80c 100644 --- a/spec/features/projects/import_export/export_file_spec.rb +++ b/spec/features/projects/import_export/export_file_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper' # It looks up for any sensitive word inside the JSON, so if a sensitive word is found # we'll have to either include it adding the model that includes it to the +safe_list+ # or make sure the attribute is blacklisted in the +import_export.yml+ configuration -describe 'Import/Export - project export integration test', :js do +RSpec.describe 'Import/Export - project export integration test', :js do include Select2Helper include ExportFileHelper diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index 33c7182c084..83ceffa621c 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Import/Export - project import integration test', :js do +RSpec.describe 'Import/Export - project import integration test', :js do include GitHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/issuable_templates_spec.rb b/spec/features/projects/issuable_templates_spec.rb index 4b6f1672f08..8f1c31f229f 100644 --- a/spec/features/projects/issuable_templates_spec.rb +++ b/spec/features/projects/issuable_templates_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'issuable templates', :js do +RSpec.describe 'issuable templates', :js do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb new file mode 100644 index 00000000000..8d5e99d7e2b --- /dev/null +++ b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'viewing issues with design references' do + include DesignManagementTestHelpers + + let_it_be(:public_project) { create(:project_empty_repo, :public) } + let_it_be(:private_project) { create(:project_empty_repo) } + + let(:user) { create(:user) } + let(:design_issue) { create(:issue, project: project) } + let(:design_a) { create(:design, :with_file, issue: design_issue) } + let(:design_b) { create(:design, :with_file, issue: design_issue) } + let(:issue_ref) { design_issue.to_reference(public_project) } + let(:design_ref_a) { design_a.to_reference(public_project) } + let(:design_ref_b) { design_b.to_reference(public_project) } + let(:design_tab_ref) { "#{issue_ref} (designs)" } + + let(:description) do + <<~MD + The designs I mentioned: + + * #{url_for_designs(design_issue)} + * #{url_for_design(design_a)} + * #{url_for_design(design_b)} + MD + end + + def visit_page_with_design_references + public_issue = create(:issue, project: public_project, description: description) + visit project_issue_path(public_issue.project, public_issue) + end + + shared_examples 'successful use of design link references' do + before do + enable_design_management + end + + it 'shows the issue description and design references', :aggregate_failures do + visit_page_with_design_references + + expect(page).to have_text('The designs I mentioned') + expect(page).to have_link(design_tab_ref) + expect(page).to have_link(design_ref_a) + expect(page).to have_link(design_ref_b) + end + end + + context 'the user has access to a public project' do + let(:project) { public_project } + + it_behaves_like 'successful use of design link references' + end + + context 'the user does not have access to a private project' do + let(:project) { private_project } + + it 'redacts inaccessible design references', :aggregate_failures do + visit_page_with_design_references + + expect(page).to have_text('The designs I mentioned') + expect(page).not_to have_link(issue_ref) + expect(page).not_to have_link(design_tab_ref) + expect(page).not_to have_link(design_ref_a) + expect(page).not_to have_link(design_ref_b) + end + end + + context 'the user has access to a private project' do + let(:project) { private_project } + + before do + project.add_developer(user) + sign_in(user) + end + + it_behaves_like 'successful use of design link references' + + context 'design management is entirely disabled' do + it 'processes design links as issue references', :aggregate_failures do + enable_design_management(false) + + visit_page_with_design_references + + expect(page).to have_text('The designs I mentioned') + expect(page).to have_link(issue_ref) + expect(page).not_to have_link(design_tab_ref) + expect(page).not_to have_link(design_ref_a) + expect(page).not_to have_link(design_ref_b) + end + end + + context 'design management is enabled, but the filter is disabled globally' do + before do + enable_design_management + stub_feature_flags( + Banzai::Filter::DesignReferenceFilter::FEATURE_FLAG => false + ) + end + + it 'processes design tab links successfully, and design references as issue references', :aggregate_failures do + visit_page_with_design_references + + expect(page).to have_text('The designs I mentioned') + expect(page).to have_link(design_tab_ref) + expect(page).to have_link(issue_ref) + expect(page).not_to have_link(design_ref_a) + expect(page).not_to have_link(design_ref_b) + end + end + + context 'design management is enabled, and the filter is enabled for the current project' do + before do + stub_feature_flags( + Banzai::Filter::DesignReferenceFilter::FEATURE_FLAG => public_project + ) + end + + it_behaves_like 'successful use of design link references' + end + end +end diff --git a/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb b/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb index d9a72f2d5c5..f871ca60596 100644 --- a/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_paginates_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User paginates issue designs', :js do +RSpec.describe 'User paginates issue designs', :js do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb b/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb index 2238e86a47f..902a84afc83 100644 --- a/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb +++ b/spec/features/projects/issues/design_management/user_permissions_upload_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User design permissions', :js do +RSpec.describe 'User design permissions', :js do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb index d160ab95a65..66b449a9de5 100644 --- a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uploads new design', :js do +RSpec.describe 'User uploads new design', :js do include DesignManagementTestHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_design_images_spec.rb b/spec/features/projects/issues/design_management/user_views_design_images_spec.rb index 3d0f4df55c4..4a4c33cb881 100644 --- a/spec/features/projects/issues/design_management/user_views_design_images_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_design_images_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Users views raw design image files' do +RSpec.describe 'Users views raw design image files' do include DesignManagementTestHelpers let_it_be(:project) { create(:project, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_design_spec.rb b/spec/features/projects/issues/design_management/user_views_design_spec.rb index 707049b0068..527442d5339 100644 --- a/spec/features/projects/issues/design_management/user_views_design_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_design_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views issue designs', :js do +RSpec.describe 'User views issue designs', :js do include DesignManagementTestHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_designs_spec.rb b/spec/features/projects/issues/design_management/user_views_designs_spec.rb index a4fb7456922..d371ae1aad7 100644 --- a/spec/features/projects/issues/design_management/user_views_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_designs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views issue designs', :js do +RSpec.describe 'User views issue designs', :js do include DesignManagementTestHelpers let_it_be(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb b/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb index a9e4aa899a7..5bc1271309c 100644 --- a/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_designs_with_svg_xss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views an SVG design that contains XSS', :js do +RSpec.describe 'User views an SVG design that contains XSS', :js do include DesignManagementTestHelpers let(:project) { create(:project_empty_repo, :public) } diff --git a/spec/features/projects/issues/viewing_issues_with_external_authorization_enabled_spec.rb b/spec/features/projects/issues/viewing_issues_with_external_authorization_enabled_spec.rb index 6c8f4b51ea0..6feefff9207 100644 --- a/spec/features/projects/issues/viewing_issues_with_external_authorization_enabled_spec.rb +++ b/spec/features/projects/issues/viewing_issues_with_external_authorization_enabled_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'viewing an issue with cross project references' do +RSpec.describe 'viewing an issue with cross project references' do include ExternalAuthorizationServiceHelpers include Gitlab::Routing.url_helpers diff --git a/spec/features/projects/jobs/permissions_spec.rb b/spec/features/projects/jobs/permissions_spec.rb index d78cf674dc6..7f46a369dd6 100644 --- a/spec/features/projects/jobs/permissions_spec.rb +++ b/spec/features/projects/jobs/permissions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Jobs Permissions' do +RSpec.describe 'Project Jobs Permissions' do let(:user) { create(:user) } let(:group) { create(:group, name: 'some group') } let(:project) { create(:project, :repository, namespace: group) } diff --git a/spec/features/projects/jobs/user_browses_job_spec.rb b/spec/features/projects/jobs/user_browses_job_spec.rb index 16ba1c1b73d..67299e852b3 100644 --- a/spec/features/projects/jobs/user_browses_job_spec.rb +++ b/spec/features/projects/jobs/user_browses_job_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User browses a job', :js do +RSpec.describe 'User browses a job', :js do let(:user) { create(:user) } let(:user_access_level) { :developer } let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/jobs/user_browses_jobs_spec.rb b/spec/features/projects/jobs/user_browses_jobs_spec.rb index 44709cb1230..c768b0e281c 100644 --- a/spec/features/projects/jobs/user_browses_jobs_spec.rb +++ b/spec/features/projects/jobs/user_browses_jobs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User browses jobs' do +RSpec.describe 'User browses jobs' do let!(:build) { create(:ci_build, :coverage, pipeline: pipeline) } let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') } let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index a17793bc6d6..e78e8989575 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'tempfile' -describe 'Jobs', :clean_gitlab_redis_shared_state do +RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do include Gitlab::Routing include ProjectForksHelper @@ -940,7 +940,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do it 'renders message about job being stuck because of no runners with the specified tags' do expect(page).to have_css('.js-stuck-with-tags') - expect(page).to have_content("This job is stuck because you don't have any active runners online with any of these tags assigned to them:") + expect(page).to have_content("This job is stuck because you don't have any active runners online or available with any of these tags assigned to them:") end end @@ -950,7 +950,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do it 'renders message about job being stuck because of no runners with the specified tags' do expect(page).to have_css('.js-stuck-with-tags') - expect(page).to have_content("This job is stuck because you don't have any active runners online with any of these tags assigned to them:") + expect(page).to have_content("This job is stuck because you don't have any active runners online or available with any of these tags assigned to them:") end end diff --git a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb index 503ac8caddf..66d61e629df 100644 --- a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb +++ b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Issue prioritization' do +RSpec.describe 'Issue prioritization' do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } diff --git a/spec/features/projects/labels/search_labels_spec.rb b/spec/features/projects/labels/search_labels_spec.rb index e2eec7400ff..04dfd4ca5f1 100644 --- a/spec/features/projects/labels/search_labels_spec.rb +++ b/spec/features/projects/labels/search_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Search for labels', :js do +RSpec.describe 'Search for labels', :js do let(:user) { create(:user) } let(:project) { create(:project) } let!(:label1) { create(:label, title: 'Foo', description: 'Lorem ipsum', project: project) } diff --git a/spec/features/projects/labels/sort_labels_spec.rb b/spec/features/projects/labels/sort_labels_spec.rb index 01c3f251173..83559b816d2 100644 --- a/spec/features/projects/labels/sort_labels_spec.rb +++ b/spec/features/projects/labels/sort_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Sort labels', :js do +RSpec.describe 'Sort labels', :js do let(:user) { create(:user) } let(:project) { create(:project) } let!(:label1) { create(:label, title: 'Foo', description: 'Lorem ipsum', project: project) } diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index 1d0f9e73a1b..7ca8a542c21 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Labels subscription' do +RSpec.describe 'Labels subscription' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :public, namespace: group) } diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 3a37ee6623d..706ea92c086 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Prioritize labels' do +RSpec.describe 'Prioritize labels' do include DragTo let(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_creates_labels_spec.rb b/spec/features/projects/labels/user_creates_labels_spec.rb index 180cd8eff14..001d23cd2c9 100644 --- a/spec/features/projects/labels/user_creates_labels_spec.rb +++ b/spec/features/projects/labels/user_creates_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User creates labels" do +RSpec.describe "User creates labels" do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_edits_labels_spec.rb b/spec/features/projects/labels/user_edits_labels_spec.rb index add959ccda6..8300a1a8542 100644 --- a/spec/features/projects/labels/user_edits_labels_spec.rb +++ b/spec/features/projects/labels/user_edits_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User edits labels" do +RSpec.describe "User edits labels" do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:label) { create(:label, project: project) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_promotes_label_spec.rb b/spec/features/projects/labels/user_promotes_label_spec.rb index cf7320d3cf9..4cb22c2e48c 100644 --- a/spec/features/projects/labels/user_promotes_label_spec.rb +++ b/spec/features/projects/labels/user_promotes_label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User promotes label' do +RSpec.describe 'User promotes label' do let_it_be(:group) { create(:group) } let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index 459adeeec30..217f86b92cf 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User removes labels" do +RSpec.describe "User removes labels" do let(:project) { create(:project_empty_repo, :public) } let(:user) { create(:user) } diff --git a/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb b/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb index 68a924e4fad..f9c65c08ec0 100644 --- a/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/projects/labels/user_sees_breadcrumb_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New project label breadcrumb' do +RSpec.describe 'New project label breadcrumb' do let(:project) { create(:project) } let(:user) { project.creator } diff --git a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb index f60e7e9703f..11aa53fd963 100644 --- a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb +++ b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Labels > User sees links to issuables' do +RSpec.describe 'Projects > Labels > User sees links to issuables' do let_it_be(:user) { create(:user) } before do diff --git a/spec/features/projects/labels/user_views_labels_spec.rb b/spec/features/projects/labels/user_views_labels_spec.rb index 7f70ac903d6..da8520ca8fb 100644 --- a/spec/features/projects/labels/user_views_labels_spec.rb +++ b/spec/features/projects/labels/user_views_labels_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User views labels" do +RSpec.describe "User views labels" do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } let(:label_titles) { %w[bug enhancement feature] } diff --git a/spec/features/projects/members/anonymous_user_sees_members_spec.rb b/spec/features/projects/members/anonymous_user_sees_members_spec.rb index 096cf97551a..3b0f00c5494 100644 --- a/spec/features/projects/members/anonymous_user_sees_members_spec.rb +++ b/spec/features/projects/members/anonymous_user_sees_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Anonymous user sees members' do +RSpec.describe 'Projects > Members > Anonymous user sees members' do let(:user) { create(:user) } let(:group) { create(:group, :public) } let(:project) { create(:project, :public) } diff --git a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb index b6f6e2ca85f..c8a9f959188 100644 --- a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Group member cannot leave group project' do +RSpec.describe 'Projects > Members > Group member cannot leave group project' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb index cf9441bcd55..34c870b8a96 100644 --- a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Group member cannot request access to their group project' do +RSpec.describe 'Projects > Members > Group member cannot request access to their group project' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } diff --git a/spec/features/projects/members/group_members_spec.rb b/spec/features/projects/members/group_members_spec.rb index d37f912a2bc..3060d2c6a43 100644 --- a/spec/features/projects/members/group_members_spec.rb +++ b/spec/features/projects/members/group_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects members' do +RSpec.describe 'Projects members' do let(:user) { create(:user) } let(:developer) { create(:user) } let(:group) { create(:group, :public) } @@ -21,7 +21,7 @@ describe 'Projects members' do context 'with a group invitee' do before do group_invitee - visit project_settings_members_path(project) + visit project_project_members_path(project) end it 'does not appear in the project members page' do @@ -70,7 +70,7 @@ describe 'Projects members' do before do group_invitee project_invitee - visit project_settings_members_path(project) + visit project_project_members_path(project) end it 'shows the project invitee, the project developer, and the group owner' do @@ -91,7 +91,7 @@ describe 'Projects members' do context 'with a group requester' do before do group.request_access(group_requester) - visit project_settings_members_path(project) + visit project_project_members_path(project) end it 'does not appear in the project members page' do @@ -105,7 +105,7 @@ describe 'Projects members' do before do group.request_access(group_requester) project.request_access(project_requester) - visit project_settings_members_path(project) + visit project_project_members_path(project) end it 'shows the project requester, the project developer, and the group owner' do @@ -129,7 +129,7 @@ describe 'Projects members' do it_behaves_like 'showing user status' do let(:user_with_status) { developer } - subject { visit project_settings_members_path(project) } + subject { visit project_project_members_path(project) } end end end diff --git a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb index ecd55f71c84..ec86b7db4fa 100644 --- a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb +++ b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Group requester cannot request access to project', :js do +RSpec.describe 'Projects > Members > Group requester cannot request access to project', :js do let(:user) { create(:user) } let(:owner) { create(:user) } let(:group) { create(:group, :public) } diff --git a/spec/features/projects/members/groups_with_access_list_spec.rb b/spec/features/projects/members/groups_with_access_list_spec.rb index 6e8d1a945e1..2ee6bc103e9 100644 --- a/spec/features/projects/members/groups_with_access_list_spec.rb +++ b/spec/features/projects/members/groups_with_access_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Groups with access list', :js do +RSpec.describe 'Projects > Members > Groups with access list', :js do let(:user) { create(:user) } let(:group) { create(:group, :public) } let(:project) { create(:project, :public) } @@ -12,7 +12,7 @@ describe 'Projects > Members > Groups with access list', :js do @group_link = create(:project_group_link, project: project, group: group) sign_in(user) - visit project_settings_members_path(project) + visit project_project_members_path(project) end it 'updates group access level' do @@ -24,7 +24,7 @@ describe 'Projects > Members > Groups with access list', :js do wait_for_requests - visit project_settings_members_path(project) + visit project_project_members_path(project) expect(first('.group_member')).to have_content('Guest') end diff --git a/spec/features/projects/members/invite_group_spec.rb b/spec/features/projects/members/invite_group_spec.rb index e76637039c6..058cbfff662 100644 --- a/spec/features/projects/members/invite_group_spec.rb +++ b/spec/features/projects/members/invite_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Members > Invite group', :js do +RSpec.describe 'Project > Members > Invite group', :js do include Select2Helper include ActionView::Helpers::DateHelper @@ -11,14 +11,14 @@ describe 'Project > Members > Invite group', :js do describe 'Share with group lock' do shared_examples 'the project can be shared with groups' do it 'the "Invite group" tab exists' do - visit project_settings_members_path(project) + visit project_project_members_path(project) expect(page).to have_selector('#invite-group-tab') end end shared_examples 'the project cannot be shared with groups' do it 'the "Invite group" tab does not exist' do - visit project_settings_members_path(project) + visit project_project_members_path(project) expect(page).not_to have_selector('#invite-group-tab') end end @@ -37,7 +37,9 @@ describe 'Project > Members > Invite group', :js do it_behaves_like 'the project can be shared with groups' it 'the project can be shared with another group' do - visit project_settings_members_path(project) + visit project_project_members_path(project) + + expect(page).not_to have_css('.project-members-groups') click_on 'invite-group-tab' @@ -118,7 +120,7 @@ describe 'Project > Members > Invite group', :js do group.add_guest(maintainer) sign_in(maintainer) - visit project_settings_members_path(project) + visit project_project_members_path(project) click_on 'invite-group-tab' @@ -151,7 +153,7 @@ describe 'Project > Members > Invite group', :js do create(:group).add_owner(maintainer) create(:group).add_owner(maintainer) - visit project_settings_members_path(project) + visit project_project_members_path(project) click_link 'Invite group' @@ -184,7 +186,7 @@ describe 'Project > Members > Invite group', :js do end it 'the groups dropdown does not show ancestors' do - visit project_settings_members_path(project) + visit project_project_members_path(project) click_on 'invite-group-tab' click_link 'Search for a group' diff --git a/spec/features/projects/members/list_spec.rb b/spec/features/projects/members/list_spec.rb index f404699b2f6..f51ebde8f80 100644 --- a/spec/features/projects/members/list_spec.rb +++ b/spec/features/projects/members/list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project members list' do +RSpec.describe 'Project members list' do include Select2Helper include Spec::Support::Helpers::Features::ListRowsHelpers @@ -113,6 +113,6 @@ describe 'Project members list' do end def visit_members_page - visit project_settings_members_path(project) + visit project_project_members_path(project) end end diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index cbcd03b33ce..979bbd57aa3 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Maintainer adds member with expiration date', :js do +RSpec.describe 'Projects > Members > Maintainer adds member with expiration date', :js do include Select2Helper include ActiveSupport::Testing::TimeHelpers diff --git a/spec/features/projects/members/master_manages_access_requests_spec.rb b/spec/features/projects/members/master_manages_access_requests_spec.rb index f113fb643f8..4c3eaa93352 100644 --- a/spec/features/projects/members/master_manages_access_requests_spec.rb +++ b/spec/features/projects/members/master_manages_access_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Maintainer manages access requests' do +RSpec.describe 'Projects > Members > Maintainer manages access requests' do it_behaves_like 'Maintainer manages access requests' do let(:entity) { create(:project, :public) } let(:members_page_path) { project_project_members_path(entity) } diff --git a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb index e2b57472b2e..fa02e815867 100644 --- a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Member cannot request access to their project' do +RSpec.describe 'Projects > Members > Member cannot request access to their project' do let(:member) { create(:user) } let(:project) { create(:project) } diff --git a/spec/features/projects/members/member_leaves_project_spec.rb b/spec/features/projects/members/member_leaves_project_spec.rb index cb7a405e821..aa7633c3b28 100644 --- a/spec/features/projects/members/member_leaves_project_spec.rb +++ b/spec/features/projects/members/member_leaves_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Member leaves project' do +RSpec.describe 'Projects > Members > Member leaves project' do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/members/owner_cannot_leave_project_spec.rb b/spec/features/projects/members/owner_cannot_leave_project_spec.rb index 781c584796d..fbe8583b236 100644 --- a/spec/features/projects/members/owner_cannot_leave_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_leave_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Owner cannot leave project' do +RSpec.describe 'Projects > Members > Owner cannot leave project' do let(:project) { create(:project) } before do diff --git a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb index 5643a29b4e4..5e6e3d4d7f2 100644 --- a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Owner cannot request access to their own project' do +RSpec.describe 'Projects > Members > Owner cannot request access to their own project' do let(:project) { create(:project) } before do diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 12f485317d8..be27cbc0d66 100644 --- a/spec/features/projects/members/sorting_spec.rb +++ b/spec/features/projects/members/sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > Sorting' do +RSpec.describe 'Projects > Members > Sorting' do let(:maintainer) { create(:user, name: 'John Doe') } let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) } let(:project) { create(:project, namespace: maintainer.namespace, creator: maintainer) } diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb index 7e7faca9741..a339130ee3c 100644 --- a/spec/features/projects/members/user_requests_access_spec.rb +++ b/spec/features/projects/members/user_requests_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Members > User requests access', :js do +RSpec.describe 'Projects > Members > User requests access', :js do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } let(:maintainer) { project.owner } diff --git a/spec/features/projects/merge_request_button_spec.rb b/spec/features/projects/merge_request_button_spec.rb index 950af8b0ae0..e3d8534ace9 100644 --- a/spec/features/projects/merge_request_button_spec.rb +++ b/spec/features/projects/merge_request_button_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge Request button' do +RSpec.describe 'Merge Request button' do shared_examples 'Merge request button only shown when allowed' do let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/projects/milestones/milestone_spec.rb b/spec/features/projects/milestones/milestone_spec.rb index fb9667cd67d..9ffb1746f3e 100644 --- a/spec/features/projects/milestones/milestone_spec.rb +++ b/spec/features/projects/milestones/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project milestone' do +RSpec.describe 'Project milestone' do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/projects/milestones/milestones_sorting_spec.rb b/spec/features/projects/milestones/milestones_sorting_spec.rb index 77cf696fb7c..565c61cfaa0 100644 --- a/spec/features/projects/milestones/milestones_sorting_spec.rb +++ b/spec/features/projects/milestones/milestones_sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Milestones sorting', :js do +RSpec.describe 'Milestones sorting', :js do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } diff --git a/spec/features/projects/milestones/new_spec.rb b/spec/features/projects/milestones/new_spec.rb index b1b74bed59d..170268297cd 100644 --- a/spec/features/projects/milestones/new_spec.rb +++ b/spec/features/projects/milestones/new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Creating a new project milestone', :js do +RSpec.describe 'Creating a new project milestone', :js do let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } diff --git a/spec/features/projects/milestones/user_interacts_with_labels_spec.rb b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb index 0177871599a..d658599c52b 100644 --- a/spec/features/projects/milestones/user_interacts_with_labels_spec.rb +++ b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User interacts with labels' do +RSpec.describe 'User interacts with labels' do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let(:milestone) { create(:milestone, project: project, title: 'v2.2', description: '# Description header') } diff --git a/spec/features/projects/navbar_spec.rb b/spec/features/projects/navbar_spec.rb index 1797ca8aa7d..94d79d60aeb 100644 --- a/spec/features/projects/navbar_spec.rb +++ b/spec/features/projects/navbar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project navbar' do +RSpec.describe 'Project navbar' do include NavbarStructureHelper include WaitForRequests diff --git a/spec/features/projects/network_graph_spec.rb b/spec/features/projects/network_graph_spec.rb index 2f6a2e90ab9..4ae809399b6 100644 --- a/spec/features/projects/network_graph_spec.rb +++ b/spec/features/projects/network_graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Network Graph', :js do +RSpec.describe 'Project Network Graph', :js do let(:user) { create :user } let(:project) { create :project, :repository, namespace: user.namespace } diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 22a0d268243..6a2ec9aa4a8 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'New project' do +RSpec.describe 'New project' do include Select2Helper context 'as a user' do diff --git a/spec/features/projects/pages_lets_encrypt_spec.rb b/spec/features/projects/pages_lets_encrypt_spec.rb index da9b191271a..302e9f5e533 100644 --- a/spec/features/projects/pages_lets_encrypt_spec.rb +++ b/spec/features/projects/pages_lets_encrypt_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe "Pages with Let's Encrypt", :https_pages_enabled do +RSpec.describe "Pages with Let's Encrypt", :https_pages_enabled do include LetsEncryptHelpers let(:project) { create(:project, pages_https_only: false) } diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb index faa2b3c9424..e1ace817c72 100644 --- a/spec/features/projects/pages_spec.rb +++ b/spec/features/projects/pages_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -shared_examples 'pages settings editing' do +RSpec.shared_examples 'pages settings editing' do let_it_be(:project) { create(:project, pages_https_only: false) } let(:user) { create(:user) } let(:role) { :maintainer } @@ -394,7 +394,7 @@ shared_examples 'pages settings editing' do end end -describe 'Pages', :js do +RSpec.describe 'Pages', :js do include LetsEncryptHelpers context 'when editing normally' do diff --git a/spec/features/projects/pipeline_schedules_spec.rb b/spec/features/projects/pipeline_schedules_spec.rb index c21b1e36f9a..921bbbfbe7d 100644 --- a/spec/features/projects/pipeline_schedules_spec.rb +++ b/spec/features/projects/pipeline_schedules_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Pipeline Schedules', :js do +RSpec.describe 'Pipeline Schedules', :js do include PipelineSchedulesHelper let!(:project) { create(:project, :repository) } diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index de81547887b..c6a002ad18b 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Pipeline', :js do +RSpec.describe 'Pipeline', :js do include RoutesHelpers include ProjectForksHelper include ::ExclusiveLeaseHelpers diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 7634100347e..0e33204f851 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Pipelines', :js do +RSpec.describe 'Pipelines', :js do include ProjectForksHelper let(:project) { create(:project) } @@ -453,10 +453,12 @@ describe 'Pipelines', :js do context 'downloadable pipelines' do context 'with artifacts' do let!(:with_artifacts) do - create(:ci_build, :artifacts, :success, + build = create(:ci_build, :success, pipeline: pipeline, name: 'rspec tests', stage: 'test') + + create(:ci_job_artifact, :codequality, job: build) end before do @@ -470,7 +472,7 @@ describe 'Pipelines', :js do it 'has artifacts download dropdown' do find('.js-pipeline-dropdown-download').click - expect(page).to have_link(with_artifacts.name) + expect(page).to have_link(with_artifacts.file_type) end it 'has download attribute on download links' do diff --git a/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb b/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb index 673766073a2..6745eb1a3fb 100644 --- a/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb +++ b/spec/features/projects/raw/user_interacts_with_raw_endpoint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Raw > User interacts with raw endpoint' do +RSpec.describe 'Projects > Raw > User interacts with raw endpoint' do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_views_edit_release_spec.rb b/spec/features/projects/releases/user_views_edit_release_spec.rb index 217d6a25a23..4ed1be6db6b 100644 --- a/spec/features/projects/releases/user_views_edit_release_spec.rb +++ b/spec/features/projects/releases/user_views_edit_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User edits Release', :js do +RSpec.describe 'User edits Release', :js do let_it_be(:project) { create(:project, :repository) } let_it_be(:release) { create(:release, project: project, name: 'The first release' ) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_views_release_spec.rb b/spec/features/projects/releases/user_views_release_spec.rb index 6120acb4f1f..c82588746a8 100644 --- a/spec/features/projects/releases/user_views_release_spec.rb +++ b/spec/features/projects/releases/user_views_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views Release', :js do +RSpec.describe 'User views Release', :js do let(:project) { create(:project, :repository) } let(:release) { create(:release, project: project, name: 'The first release' ) } let(:user) { create(:user) } diff --git a/spec/features/projects/releases/user_views_releases_spec.rb b/spec/features/projects/releases/user_views_releases_spec.rb index e21d8ec16e1..962d5551631 100644 --- a/spec/features/projects/releases/user_views_releases_spec.rb +++ b/spec/features/projects/releases/user_views_releases_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views releases', :js do +RSpec.describe 'User views releases', :js do let_it_be(:project) { create(:project, :repository, :private) } let_it_be(:release) { create(:release, project: project, name: 'The first release' ) } let_it_be(:maintainer) { create(:user) } @@ -26,47 +26,65 @@ describe 'User views releases', :js do expect(page).not_to have_content('Upcoming Release') end - context 'when there is a link as an asset' do - let!(:release_link) { create(:release_link, release: release, url: url ) } - let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } - let(:direct_asset_link) { Gitlab::Routing.url_helpers.project_release_url(project, release) << release_link.filepath } - - it 'sees the link' do - visit project_releases_path(project) - - page.within('.js-assets-list') do - expect(page).to have_link release_link.name, href: direct_asset_link - expect(page).not_to have_content('(external source)') - end - end - - context 'when there is a link redirect' do - let!(:release_link) { create(:release_link, release: release, name: 'linux-amd64 binaries', filepath: '/binaries/linux-amd64', url: url) } + shared_examples 'asset link tests' do + context 'when there is a link as an asset' do + let!(:release_link) { create(:release_link, release: release, url: url ) } let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } + let(:direct_asset_link) { Gitlab::Routing.url_helpers.project_release_url(project, release) << release_link.filepath } it 'sees the link' do visit project_releases_path(project) page.within('.js-assets-list') do expect(page).to have_link release_link.name, href: direct_asset_link - expect(page).not_to have_content('(external source)') + expect(page).not_to have_css('[data-testid="external-link-indicator"]') end end - end - context 'when url points to external resource' do - let(:url) { 'http://google.com/download' } + context 'when there is a link redirect' do + let!(:release_link) { create(:release_link, release: release, name: 'linux-amd64 binaries', filepath: '/binaries/linux-amd64', url: url) } + let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } - it 'sees that the link is external resource' do - visit project_releases_path(project) + it 'sees the link' do + visit project_releases_path(project) - page.within('.js-assets-list') do - expect(page).to have_content('(external source)') + page.within('.js-assets-list') do + expect(page).to have_link release_link.name, href: direct_asset_link + expect(page).not_to have_css('[data-testid="external-link-indicator"]') + end + end + end + + context 'when url points to external resource' do + let(:url) { 'http://google.com/download' } + + it 'sees that the link is external resource' do + visit project_releases_path(project) + + page.within('.js-assets-list') do + expect(page).to have_css('[data-testid="external-link-indicator"]') + end end end end end + context 'when the release_asset_link_type feature flag is enabled' do + before do + stub_feature_flags(release_asset_link_type: true) + end + + it_behaves_like 'asset link tests' + end + + context 'when the release_asset_link_type feature flag is disabled' do + before do + stub_feature_flags(release_asset_link_type: false) + end + + it_behaves_like 'asset link tests' + end + context 'with an upcoming release' do let(:tomorrow) { Time.zone.now + 1.day } let!(:release) { create(:release, project: project, released_at: tomorrow ) } @@ -80,7 +98,7 @@ describe 'User views releases', :js do context 'with a tag containing a slash' do it 'sees the release' do - release = create :release, :with_evidence, project: project, tag: 'debian/2.4.0-1' + release = create :release, project: project, tag: 'debian/2.4.0-1' visit project_releases_path(project) expect(page).to have_content(release.name) diff --git a/spec/features/projects/remote_mirror_spec.rb b/spec/features/projects/remote_mirror_spec.rb index d357aabead7..26d27c914cc 100644 --- a/spec/features/projects/remote_mirror_spec.rb +++ b/spec/features/projects/remote_mirror_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project remote mirror', :feature do +RSpec.describe 'Project remote mirror', :feature do let(:project) { create(:project, :repository, :remote_mirror) } let(:remote_mirror) { project.remote_mirrors.first } let(:user) { create(:user) } diff --git a/spec/features/projects/serverless/functions_spec.rb b/spec/features/projects/serverless/functions_spec.rb index 4c89af29339..a0b06d7e2a1 100644 --- a/spec/features/projects/serverless/functions_spec.rb +++ b/spec/features/projects/serverless/functions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Functions', :js do +RSpec.describe 'Functions', :js do include KubernetesHelpers include ReactiveCachingHelpers diff --git a/spec/features/projects/services/disable_triggers_spec.rb b/spec/features/projects/services/disable_triggers_spec.rb index d07abb94208..8f87d0e7ff1 100644 --- a/spec/features/projects/services/disable_triggers_spec.rb +++ b/spec/features/projects/services/disable_triggers_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' -describe 'Disable individual triggers' do +RSpec.describe 'Disable individual triggers', :js do include_context 'project service activation' - let(:checkbox_selector) { 'input[type=checkbox][id$=_events]' } + let(:checkbox_selector) { 'input[type=checkbox][name$="_events]"]' } before do visit_project_integration(service_name) diff --git a/spec/features/projects/services/prometheus_external_alerts_spec.rb b/spec/features/projects/services/prometheus_external_alerts_spec.rb index 1a706f20352..4c32905a8c5 100644 --- a/spec/features/projects/services/prometheus_external_alerts_spec.rb +++ b/spec/features/projects/services/prometheus_external_alerts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Prometheus external alerts', :js do +RSpec.describe 'Prometheus external alerts', :js do include_context 'project service activation' let(:alerts_section_selector) { '.js-prometheus-alerts' } diff --git a/spec/features/projects/services/user_activates_alerts_spec.rb b/spec/features/projects/services/user_activates_alerts_spec.rb index 47de7fab859..95642f49d61 100644 --- a/spec/features/projects/services/user_activates_alerts_spec.rb +++ b/spec/features/projects/services/user_activates_alerts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Alerts', :js do +RSpec.describe 'User activates Alerts', :js do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/services/user_activates_asana_spec.rb b/spec/features/projects/services/user_activates_asana_spec.rb index dac60fce6e9..3e24d106be0 100644 --- a/spec/features/projects/services/user_activates_asana_spec.rb +++ b/spec/features/projects/services/user_activates_asana_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Asana' do +RSpec.describe 'User activates Asana' do include_context 'project service activation' it 'activates service', :js do diff --git a/spec/features/projects/services/user_activates_assembla_spec.rb b/spec/features/projects/services/user_activates_assembla_spec.rb index 999a95e3e23..2e49f4caa82 100644 --- a/spec/features/projects/services/user_activates_assembla_spec.rb +++ b/spec/features/projects/services/user_activates_assembla_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Assembla' do +RSpec.describe 'User activates Assembla' do include_context 'project service activation' before do diff --git a/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb b/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb index 28ed08f71b6..7b89b9ac4a7 100644 --- a/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb +++ b/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Atlassian Bamboo CI' do +RSpec.describe 'User activates Atlassian Bamboo CI' do include_context 'project service activation' before do @@ -23,6 +23,6 @@ describe 'User activates Atlassian Bamboo CI' do # Password field should not be filled in. click_link('Atlassian Bamboo CI') - expect(find_field('Enter new password').value).to be_blank + expect(find_field('Enter new Password').value).to be_blank end end diff --git a/spec/features/projects/services/user_activates_emails_on_push_spec.rb b/spec/features/projects/services/user_activates_emails_on_push_spec.rb index 42c069eb29e..40947027146 100644 --- a/spec/features/projects/services/user_activates_emails_on_push_spec.rb +++ b/spec/features/projects/services/user_activates_emails_on_push_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Emails on push' do +RSpec.describe 'User activates Emails on push' do include_context 'project service activation' it 'activates service', :js do diff --git a/spec/features/projects/services/user_activates_flowdock_spec.rb b/spec/features/projects/services/user_activates_flowdock_spec.rb index 4762363b3fe..9581d718400 100644 --- a/spec/features/projects/services/user_activates_flowdock_spec.rb +++ b/spec/features/projects/services/user_activates_flowdock_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Flowdock' do +RSpec.describe 'User activates Flowdock' do include_context 'project service activation' do let(:project) { create(:project, :repository) } end diff --git a/spec/features/projects/services/user_activates_hipchat_spec.rb b/spec/features/projects/services/user_activates_hipchat_spec.rb index 2fb056f3533..a2820c4bb0f 100644 --- a/spec/features/projects/services/user_activates_hipchat_spec.rb +++ b/spec/features/projects/services/user_activates_hipchat_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates HipChat', :js do +RSpec.describe 'User activates HipChat', :js do include_context 'project service activation' context 'with standart settings' do diff --git a/spec/features/projects/services/user_activates_irker_spec.rb b/spec/features/projects/services/user_activates_irker_spec.rb index 56df403499c..fad40fa6085 100644 --- a/spec/features/projects/services/user_activates_irker_spec.rb +++ b/spec/features/projects/services/user_activates_irker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Irker (IRC gateway)' do +RSpec.describe 'User activates Irker (IRC gateway)' do include_context 'project service activation' it 'activates service', :js do diff --git a/spec/features/projects/services/user_activates_issue_tracker_spec.rb b/spec/features/projects/services/user_activates_issue_tracker_spec.rb index 3c5005d0c0c..a2a2604c610 100644 --- a/spec/features/projects/services/user_activates_issue_tracker_spec.rb +++ b/spec/features/projects/services/user_activates_issue_tracker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates issue tracker', :js do +RSpec.describe 'User activates issue tracker', :js do include_context 'project service activation' let(:url) { 'http://tracker.example.com' } diff --git a/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb b/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb index 8c84a81ac89..8ee369eb6ec 100644 --- a/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb +++ b/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates JetBrains TeamCity CI' do +RSpec.describe 'User activates JetBrains TeamCity CI' do include_context 'project service activation' before do @@ -12,7 +12,7 @@ describe 'User activates JetBrains TeamCity CI' do it 'activates service', :js do visit_project_integration('JetBrains TeamCity CI') check('Push') - check('Merge request') + check('Merge Request') fill_in('Teamcity url', with: 'http://teamcity.example.com') fill_in('Build type', with: 'GitlabTest_Build') fill_in('Username', with: 'user') diff --git a/spec/features/projects/services/user_activates_jira_spec.rb b/spec/features/projects/services/user_activates_jira_spec.rb index a14dbf9c14d..1da8a49699b 100644 --- a/spec/features/projects/services/user_activates_jira_spec.rb +++ b/spec/features/projects/services/user_activates_jira_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Jira', :js do +RSpec.describe 'User activates Jira', :js do include_context 'project service activation' let(:url) { 'http://jira.example.com' } diff --git a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb index c6825ee663a..a6b4aaccfb5 100644 --- a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Set up Mattermost slash commands', :js do +RSpec.describe 'Set up Mattermost slash commands', :js do describe 'user visits the mattermost slash command config page' do include_context 'project service activation' diff --git a/spec/features/projects/services/user_activates_packagist_spec.rb b/spec/features/projects/services/user_activates_packagist_spec.rb index 274f293ebf3..70cf612bb2a 100644 --- a/spec/features/projects/services/user_activates_packagist_spec.rb +++ b/spec/features/projects/services/user_activates_packagist_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Packagist' do +RSpec.describe 'User activates Packagist' do include_context 'project service activation' before do diff --git a/spec/features/projects/services/user_activates_pivotaltracker_spec.rb b/spec/features/projects/services/user_activates_pivotaltracker_spec.rb index c81c5081867..8e99c6e303b 100644 --- a/spec/features/projects/services/user_activates_pivotaltracker_spec.rb +++ b/spec/features/projects/services/user_activates_pivotaltracker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates PivotalTracker' do +RSpec.describe 'User activates PivotalTracker' do include_context 'project service activation' before do diff --git a/spec/features/projects/services/user_activates_prometheus_spec.rb b/spec/features/projects/services/user_activates_prometheus_spec.rb index 76dc7d1bbc8..89b1f447c32 100644 --- a/spec/features/projects/services/user_activates_prometheus_spec.rb +++ b/spec/features/projects/services/user_activates_prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Prometheus' do +RSpec.describe 'User activates Prometheus' do include_context 'project service activation' before do diff --git a/spec/features/projects/services/user_activates_pushover_spec.rb b/spec/features/projects/services/user_activates_pushover_spec.rb index 62e03e68aee..789cc30a42e 100644 --- a/spec/features/projects/services/user_activates_pushover_spec.rb +++ b/spec/features/projects/services/user_activates_pushover_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Pushover' do +RSpec.describe 'User activates Pushover' do include_context 'project service activation' before do diff --git a/spec/features/projects/services/user_activates_slack_notifications_spec.rb b/spec/features/projects/services/user_activates_slack_notifications_spec.rb index 12f15699e26..20e2bd3f085 100644 --- a/spec/features/projects/services/user_activates_slack_notifications_spec.rb +++ b/spec/features/projects/services/user_activates_slack_notifications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User activates Slack notifications' do +RSpec.describe 'User activates Slack notifications', :js do include_context 'project service activation' context 'when service is not configured yet' do @@ -10,7 +10,7 @@ describe 'User activates Slack notifications' do visit_project_integration('Slack notifications') end - it 'activates service', :js do + it 'activates service' do fill_in('Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685') click_test_then_save_integration @@ -38,13 +38,13 @@ describe 'User activates Slack notifications' do end it 'filters events by channel' do - expect(page.find_field('service_push_channel').value).to have_content('1') - expect(page.find_field('service_issue_channel').value).to have_content('2') - expect(page.find_field('service_merge_request_channel').value).to have_content('3') - expect(page.find_field('service_note_channel').value).to have_content('4') - expect(page.find_field('service_tag_push_channel').value).to have_content('5') - expect(page.find_field('service_pipeline_channel').value).to have_content('6') - expect(page.find_field('service_wiki_page_channel').value).to have_content('7') + expect(page.find_field(name: 'service[push_channel]').value).to have_content('1') + expect(page.find_field(name: 'service[issue_channel]').value).to have_content('2') + expect(page.find_field(name: 'service[merge_request_channel]').value).to have_content('3') + expect(page.find_field(name: 'service[note_channel]').value).to have_content('4') + expect(page.find_field(name: 'service[tag_push_channel]').value).to have_content('5') + expect(page.find_field(name: 'service[pipeline_channel]').value).to have_content('6') + expect(page.find_field(name: 'service[wiki_page_channel]').value).to have_content('7') end end end diff --git a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb index 05f1a0c6b17..360e462b935 100644 --- a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb +++ b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Slack slash commands' do +RSpec.describe 'Slack slash commands', :js do include_context 'project service activation' before do @@ -10,7 +10,7 @@ describe 'Slack slash commands' do end it 'shows a token placeholder' do - token_placeholder = find_field('service_token')['placeholder'] + token_placeholder = find_field('Token')['placeholder'] expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx') end @@ -19,8 +19,8 @@ describe 'Slack slash commands' do expect(page).to have_content('This service allows users to perform common') end - it 'redirects to the integrations page after saving but not activating', :js do - fill_in 'service_token', with: 'token' + it 'redirects to the integrations page after saving but not activating' do + fill_in 'Token', with: 'token' click_active_toggle click_on 'Save' @@ -28,8 +28,8 @@ describe 'Slack slash commands' do expect(page).to have_content('Slack slash commands settings saved, but not activated.') end - it 'redirects to the integrations page after activating', :js do - fill_in 'service_token', with: 'token' + it 'redirects to the integrations page after activating' do + fill_in 'Token', with: 'token' click_on 'Save' expect(current_path).to eq(project_settings_integrations_path(project)) diff --git a/spec/features/projects/services/user_views_services_spec.rb b/spec/features/projects/services/user_views_services_spec.rb index 6df0123c30a..fef6b7bd991 100644 --- a/spec/features/projects/services/user_views_services_spec.rb +++ b/spec/features/projects/services/user_views_services_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views services' do +RSpec.describe 'User views services' do include_context 'project service activation' it 'shows the list of available services' do diff --git a/spec/features/projects/settings/access_tokens_spec.rb b/spec/features/projects/settings/access_tokens_spec.rb index 9a8a8e38164..45fe19deb8e 100644 --- a/spec/features/projects/settings/access_tokens_spec.rb +++ b/spec/features/projects/settings/access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Settings > Access Tokens', :js do +RSpec.describe 'Project > Settings > Access Tokens', :js do let_it_be(:user) { create(:user) } let_it_be(:bot_user) { create(:user, :project_bot) } let_it_be(:project) { create(:project) } diff --git a/spec/features/projects/settings/external_authorization_service_settings_spec.rb b/spec/features/projects/settings/external_authorization_service_settings_spec.rb index 31b2892cf6f..c236c85b773 100644 --- a/spec/features/projects/settings/external_authorization_service_settings_spec.rb +++ b/spec/features/projects/settings/external_authorization_service_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > External Authorization Classification Label setting' do +RSpec.describe 'Projects > Settings > External Authorization Classification Label setting' do let(:user) { create(:user) } let(:project) { create(:project_empty_repo) } diff --git a/spec/features/projects/settings/forked_project_settings_spec.rb b/spec/features/projects/settings/forked_project_settings_spec.rb index a2c6dd8e288..f6c25d483ad 100644 --- a/spec/features/projects/settings/forked_project_settings_spec.rb +++ b/spec/features/projects/settings/forked_project_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > For a forked project', :js do +RSpec.describe 'Projects > Settings > For a forked project', :js do include ProjectForksHelper let(:user) { create(:user) } let(:original_project) { create(:project) } diff --git a/spec/features/projects/settings/lfs_settings_spec.rb b/spec/features/projects/settings/lfs_settings_spec.rb index 5fa3b9bba55..6e1be3c7e51 100644 --- a/spec/features/projects/settings/lfs_settings_spec.rb +++ b/spec/features/projects/settings/lfs_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > LFS settings' do +RSpec.describe 'Projects > Settings > LFS settings' do let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :maintainer } diff --git a/spec/features/projects/settings/operations_settings_spec.rb b/spec/features/projects/settings/operations_settings_spec.rb index 752353cf2f5..dfbb6342173 100644 --- a/spec/features/projects/settings/operations_settings_spec.rb +++ b/spec/features/projects/settings/operations_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > For a forked project', :js do +RSpec.describe 'Projects > Settings > For a forked project', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository, create_templates: :issue) } let(:role) { :maintainer } diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index 87e467571e6..0358acc8dcc 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Projects > Settings > Pipelines settings" do +RSpec.describe "Projects > Settings > Pipelines settings" do let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/settings/project_badges_spec.rb b/spec/features/projects/settings/project_badges_spec.rb index c419bb1868c..2c26168e3c0 100644 --- a/spec/features/projects/settings/project_badges_spec.rb +++ b/spec/features/projects/settings/project_badges_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Badges' do +RSpec.describe 'Project Badges' do include WaitForRequests let(:user) { create(:user) } diff --git a/spec/features/projects/settings/project_settings_spec.rb b/spec/features/projects/settings/project_settings_spec.rb index 171c7920878..7b2b5594c22 100644 --- a/spec/features/projects/settings/project_settings_spec.rb +++ b/spec/features/projects/settings/project_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects settings' do +RSpec.describe 'Projects settings' do let_it_be(:project) { create(:project) } let(:user) { project.owner } let(:panel) { find('.general-settings', match: :first) } diff --git a/spec/features/projects/settings/registry_settings_spec.rb b/spec/features/projects/settings/registry_settings_spec.rb index ba92e8bc516..3dcb7ca54a1 100644 --- a/spec/features/projects/settings/registry_settings_spec.rb +++ b/spec/features/projects/settings/registry_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Settings > CI/CD > Container registry tag expiration policy', :js do +RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration policy', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace, container_registry_enabled: container_registry_enabled) } let(:container_registry_enabled) { true } @@ -29,7 +29,7 @@ describe 'Project > Settings > CI/CD > Container registry tag expiration policy' select('7 days until tags are automatically removed', from: 'Expiration interval:') select('Every day', from: 'Expiration schedule:') select('50 tags per image name', from: 'Number of tags to retain:') - fill_in('Tags with names matching this regex pattern will expire:', with: '*-production') + fill_in('Tags with names matching this regex pattern will expire:', with: '.*-production') end submit_button = find('.card-footer .btn.btn-success') expect(submit_button).not_to be_disabled @@ -38,6 +38,19 @@ describe 'Project > Settings > CI/CD > Container registry tag expiration policy' toast = find('.gl-toast') expect(toast).to have_content('Expiration policy successfully saved.') end + + it 'does not save expiration policy submit form with invalid regex' do + within '#js-registry-policies' do + within '.card-body' do + fill_in('Tags with names matching this regex pattern will expire:', with: '*-production') + end + submit_button = find('.card-footer .btn.btn-success') + expect(submit_button).not_to be_disabled + submit_button.click + end + toast = find('.gl-toast') + expect(toast).to have_content('Something went wrong while updating the expiration policy.') + end end context 'when registry is disabled' do diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index b8baaa3e963..8beecedf85f 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > Repository settings' do +RSpec.describe 'Projects > Settings > Repository settings' do let(:project) { create(:project_empty_repo) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/settings/user_archives_project_spec.rb b/spec/features/projects/settings/user_archives_project_spec.rb index 7667fad7b03..03ea9e7c580 100644 --- a/spec/features/projects/settings/user_archives_project_spec.rb +++ b/spec/features/projects/settings/user_archives_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User archives a project' do +RSpec.describe 'Projects > Settings > User archives a project' do let(:user) { create(:user) } before do diff --git a/spec/features/projects/settings/user_changes_avatar_spec.rb b/spec/features/projects/settings/user_changes_avatar_spec.rb index 67789b869da..92d5b4c1fcd 100644 --- a/spec/features/projects/settings/user_changes_avatar_spec.rb +++ b/spec/features/projects/settings/user_changes_avatar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User changes avatar' do +RSpec.describe 'Projects > Settings > User changes avatar' do let(:project) { create(:project, :repository) } let(:user) { project.creator } diff --git a/spec/features/projects/settings/user_changes_default_branch_spec.rb b/spec/features/projects/settings/user_changes_default_branch_spec.rb index 411fc0c7e07..84e6c50cf61 100644 --- a/spec/features/projects/settings/user_changes_default_branch_spec.rb +++ b/spec/features/projects/settings/user_changes_default_branch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User changes default branch' do +RSpec.describe 'Projects > Settings > User changes default branch' do include Select2Helper let(:user) { create(:user) } diff --git a/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb b/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb index 45a16fda2cb..ba504624823 100644 --- a/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb +++ b/spec/features/projects/settings/user_interacts_with_deploy_keys_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User interacts with deploy keys", :js do +RSpec.describe "User interacts with deploy keys", :js do let(:project) { create(:project, :repository) } let(:user) { project.owner } diff --git a/spec/features/projects/settings/user_manages_group_links_spec.rb b/spec/features/projects/settings/user_manages_group_links_spec.rb deleted file mode 100644 index 7df0bbb9d02..00000000000 --- a/spec/features/projects/settings/user_manages_group_links_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'Projects > Settings > User manages group links' do - include Select2Helper - - let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } - let(:group_ops) { create(:group, name: 'Ops') } - let(:group_market) { create(:group, name: 'Market', path: 'market') } - - before do - project.add_maintainer(user) - group_market.add_guest(user) - sign_in(user) - - share_link = project.project_group_links.new(group_access: Gitlab::Access::MAINTAINER) - share_link.group_id = group_ops.id - share_link.save! - - visit(project_group_links_path(project)) - end - - it 'shows a list of groups' do - page.within('.project-members-groups') do - expect(page).to have_content('Ops') - expect(page).not_to have_content('Market') - end - end - - it 'invites a group to a project', :js do - click_link('Invite group') - - select2(group_market.id, from: '#link_group_id') - select('Maintainer', from: 'link_group_access') - - click_button('Invite') - - page.within('.project-members-groups') do - expect(page).to have_content('Market') - end - end -end diff --git a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb index c0089e3c28c..3fc1f47d98a 100644 --- a/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/user_manages_merge_requests_settings_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe 'Projects > Settings > User manages merge request settings' do +RSpec.describe 'Projects > Settings > User manages merge request settings' do let(:user) { create(:user) } let(:project) { create(:project, :public, namespace: user.namespace, path: 'gitlab', name: 'sample') } diff --git a/spec/features/projects/settings/user_manages_project_members_spec.rb b/spec/features/projects/settings/user_manages_project_members_spec.rb index 705c60f15ee..d32f4cb8ec7 100644 --- a/spec/features/projects/settings/user_manages_project_members_spec.rb +++ b/spec/features/projects/settings/user_manages_project_members_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User manages project members' do +RSpec.describe 'Projects > Settings > User manages project members' do let(:group) { create(:group, name: 'OpenSource') } let(:project) { create(:project) } let(:project2) { create(:project) } diff --git a/spec/features/projects/settings/user_renames_a_project_spec.rb b/spec/features/projects/settings/user_renames_a_project_spec.rb index 789c5e31748..6088ea31661 100644 --- a/spec/features/projects/settings/user_renames_a_project_spec.rb +++ b/spec/features/projects/settings/user_renames_a_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User renames a project' do +RSpec.describe 'Projects > Settings > User renames a project' do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace, path: 'gitlab', name: 'sample') } diff --git a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb index 0abc4b41a2b..d0f297d2067 100644 --- a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb +++ b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Repository Settings > User sees revoke deploy token modal', :js do +RSpec.describe 'Repository Settings > User sees revoke deploy token modal', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:role) { :developer } diff --git a/spec/features/projects/settings/user_tags_project_spec.rb b/spec/features/projects/settings/user_tags_project_spec.rb index a919dd0e4af..ff19ed22744 100644 --- a/spec/features/projects/settings/user_tags_project_spec.rb +++ b/spec/features/projects/settings/user_tags_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User tags a project' do +RSpec.describe 'Projects > Settings > User tags a project' do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } diff --git a/spec/features/projects/settings/user_transfers_a_project_spec.rb b/spec/features/projects/settings/user_transfers_a_project_spec.rb index 8989eac77b5..ba4c379ef0a 100644 --- a/spec/features/projects/settings/user_transfers_a_project_spec.rb +++ b/spec/features/projects/settings/user_transfers_a_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > User transfers a project', :js do +RSpec.describe 'Projects > Settings > User transfers a project', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository, namespace: user.namespace) } let(:group) { create(:group) } diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index a2b36874aea..6cecbbdb3d0 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > Visibility settings', :js do +RSpec.describe 'Projects > Settings > Visibility settings', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace, visibility_level: 20) } diff --git a/spec/features/projects/settings/webhooks_settings_spec.rb b/spec/features/projects/settings/webhooks_settings_spec.rb index 7e22117c63c..d184f08bd89 100644 --- a/spec/features/projects/settings/webhooks_settings_spec.rb +++ b/spec/features/projects/settings/webhooks_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Settings > Webhook Settings' do +RSpec.describe 'Projects > Settings > Webhook Settings' do let(:project) { create(:project) } let(:user) { create(:user) } let(:webhooks_path) { project_hooks_path(project) } diff --git a/spec/features/projects/show/developer_views_empty_project_instructions_spec.rb b/spec/features/projects/show/developer_views_empty_project_instructions_spec.rb index 70dc6c966ba..8d239cb2cbf 100644 --- a/spec/features/projects/show/developer_views_empty_project_instructions_spec.rb +++ b/spec/features/projects/show/developer_views_empty_project_instructions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > Developer views empty project instructions' do +RSpec.describe 'Projects > Show > Developer views empty project instructions' do let(:project) { create(:project, :empty_repo) } let(:developer) { create(:user) } diff --git a/spec/features/projects/show/download_buttons_spec.rb b/spec/features/projects/show/download_buttons_spec.rb index 0d609069426..e73bb3198e6 100644 --- a/spec/features/projects/show/download_buttons_spec.rb +++ b/spec/features/projects/show/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > Download buttons' do +RSpec.describe 'Projects > Show > Download buttons' do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/show/no_password_spec.rb b/spec/features/projects/show/no_password_spec.rb index 0048b1bf017..79cd65e5406 100644 --- a/spec/features/projects/show/no_password_spec.rb +++ b/spec/features/projects/show/no_password_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'No Password Alert' do +RSpec.describe 'No Password Alert' do let(:project) { create(:project, :repository, namespace: user.namespace) } context 'with internal auth enabled' do diff --git a/spec/features/projects/show/redirects_spec.rb b/spec/features/projects/show/redirects_spec.rb index 1b579ab0121..659edda5672 100644 --- a/spec/features/projects/show/redirects_spec.rb +++ b/spec/features/projects/show/redirects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > Redirects' do +RSpec.describe 'Projects > Show > Redirects' do let(:user) { create :user } let(:public_project) { create :project, :public } let(:private_project) { create :project, :private } diff --git a/spec/features/projects/show/rss_spec.rb b/spec/features/projects/show/rss_spec.rb index 4fe1fde5bdd..0bd6e9cbe3b 100644 --- a/spec/features/projects/show/rss_spec.rb +++ b/spec/features/projects/show/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > RSS' do +RSpec.describe 'Projects > Show > RSS' do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_path(project) } diff --git a/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb index df63856492e..59f1bc94226 100644 --- a/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb +++ b/spec/features/projects/show/user_interacts_with_auto_devops_banner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Show > User interacts with auto devops implicitly enabled banner' do +RSpec.describe 'Project > Show > User interacts with auto devops implicitly enabled banner' do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/show/user_interacts_with_stars_spec.rb b/spec/features/projects/show/user_interacts_with_stars_spec.rb index e4cd8294f7a..99f84c19bf3 100644 --- a/spec/features/projects/show/user_interacts_with_stars_spec.rb +++ b/spec/features/projects/show/user_interacts_with_stars_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User interacts with project stars' do +RSpec.describe 'Projects > Show > User interacts with project stars' do let(:project) { create(:project, :public, :repository) } context 'when user is signed in', :js do diff --git a/spec/features/projects/show/user_manages_notifications_spec.rb b/spec/features/projects/show/user_manages_notifications_spec.rb index 0cd6743304e..58a2c793b7b 100644 --- a/spec/features/projects/show/user_manages_notifications_spec.rb +++ b/spec/features/projects/show/user_manages_notifications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User manages notifications', :js do +RSpec.describe 'Projects > Show > User manages notifications', :js do let(:project) { create(:project, :public, :repository) } before do diff --git a/spec/features/projects/show/user_sees_collaboration_links_spec.rb b/spec/features/projects/show/user_sees_collaboration_links_spec.rb index 63fcec4f9b3..ffdfbb9fe81 100644 --- a/spec/features/projects/show/user_sees_collaboration_links_spec.rb +++ b/spec/features/projects/show/user_sees_collaboration_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > Collaboration links', :js do +RSpec.describe 'Projects > Show > Collaboration links', :js do using RSpec::Parameterized::TableSyntax let(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb index bdd0ab688f0..5e878411f6a 100644 --- a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb +++ b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User sees a deletion failure message' do +RSpec.describe 'Projects > Show > User sees a deletion failure message' do let(:project) { create(:project, :empty_repo, pending_delete: true) } before do diff --git a/spec/features/projects/show/user_sees_git_instructions_spec.rb b/spec/features/projects/show/user_sees_git_instructions_spec.rb index 0c486056329..a35f6420bdc 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User sees Git instructions' do +RSpec.describe 'Projects > Show > User sees Git instructions' do let_it_be(:user) { create(:user) } shared_examples_for 'redirects to the sign in page' do diff --git a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb index c0fcd10f394..0aa0f7754c6 100644 --- a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb +++ b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User sees last commit CI status' do +RSpec.describe 'Projects > Show > User sees last commit CI status' do let_it_be(:project) { create(:project, :repository, :public) } it 'shows the project README', :js do diff --git a/spec/features/projects/show/user_sees_readme_spec.rb b/spec/features/projects/show/user_sees_readme_spec.rb index 52745b06cd3..250f707948e 100644 --- a/spec/features/projects/show/user_sees_readme_spec.rb +++ b/spec/features/projects/show/user_sees_readme_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User sees README' do +RSpec.describe 'Projects > Show > User sees README' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository, :public) } diff --git a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb index 8e20facda15..0f10b0a4010 100644 --- a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb +++ b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User sees setup shortcut buttons' do +RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do # For "New file", "Add license" functionality, # see spec/features/projects/files/project_owner_creates_license_file_spec.rb # see spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb diff --git a/spec/features/projects/show/user_uploads_files_spec.rb b/spec/features/projects/show/user_uploads_files_spec.rb index e279cdf92da..053598a528e 100644 --- a/spec/features/projects/show/user_uploads_files_spec.rb +++ b/spec/features/projects/show/user_uploads_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Show > User uploads files' do +RSpec.describe 'Projects > Show > User uploads files' do include DropzoneHelper let(:user) { create(:user) } diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index 1e8f9fa0875..73d033cbdb8 100644 --- a/spec/features/projects/snippets/create_snippet_spec.rb +++ b/spec/features/projects/snippets/create_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples_for 'snippet editor' do +RSpec.shared_examples_for 'snippet editor' do before do stub_feature_flags(snippets_edit_vue: false) end @@ -138,7 +138,7 @@ shared_examples_for 'snippet editor' do end end -describe 'Projects > Snippets > Create Snippet', :js do +RSpec.describe 'Projects > Snippets > Create Snippet', :js do include DropzoneHelper let_it_be(:user) { create(:user) } diff --git a/spec/features/projects/snippets/show_spec.rb b/spec/features/projects/snippets/show_spec.rb index 9be226c017f..0f6429d49f6 100644 --- a/spec/features/projects/snippets/show_spec.rb +++ b/spec/features/projects/snippets/show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Snippets > Project snippet', :js do +RSpec.describe 'Projects > Snippets > Project snippet', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:snippet) { create(:project_snippet, project: project, file_name: file_name, content: content) } diff --git a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb index a7a220b926d..2784fec3dc1 100644 --- a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb +++ b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Snippets > User comments on a snippet', :js do +RSpec.describe 'Projects > Snippets > User comments on a snippet', :js do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } let_it_be(:snippet) { create(:project_snippet, :repository, project: project, author: user) } diff --git a/spec/features/projects/snippets/user_deletes_snippet_spec.rb b/spec/features/projects/snippets/user_deletes_snippet_spec.rb index 7e337710e19..44fe9834484 100644 --- a/spec/features/projects/snippets/user_deletes_snippet_spec.rb +++ b/spec/features/projects/snippets/user_deletes_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Snippets > User deletes a snippet' do +RSpec.describe 'Projects > Snippets > User deletes a snippet' do let(:project) { create(:project) } let!(:snippet) { create(:project_snippet, project: project, author: user) } let(:user) { create(:user) } diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index d19fe9e8d38..a40113bd93e 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Snippets > User updates a snippet', :js do +RSpec.describe 'Projects > Snippets > User updates a snippet', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: user.namespace) } let_it_be(:snippet, reload: true) { create(:project_snippet, :repository, project: project, author: user) } diff --git a/spec/features/projects/snippets/user_views_snippets_spec.rb b/spec/features/projects/snippets/user_views_snippets_spec.rb index 22910029ee5..bc8cba1dc31 100644 --- a/spec/features/projects/snippets/user_views_snippets_spec.rb +++ b/spec/features/projects/snippets/user_views_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Snippets > User views snippets' do +RSpec.describe 'Projects > Snippets > User views snippets' do let_it_be(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/features/projects/sourcegraph_csp_spec.rb b/spec/features/projects/sourcegraph_csp_spec.rb index f252d3cd027..25d27462aa9 100644 --- a/spec/features/projects/sourcegraph_csp_spec.rb +++ b/spec/features/projects/sourcegraph_csp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Sourcegraph Content Security Policy' do +RSpec.describe 'Sourcegraph Content Security Policy' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb index d6faec2078d..8c1d88276df 100644 --- a/spec/features/projects/sub_group_issuables_spec.rb +++ b/spec/features/projects/sub_group_issuables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Subgroup Issuables', :js do +RSpec.describe 'Subgroup Issuables', :js do let!(:group) { create(:group, name: 'group') } let!(:subgroup) { create(:group, parent: group, name: 'subgroup') } let!(:project) { create(:project, namespace: subgroup, name: 'project') } diff --git a/spec/features/projects/tags/download_buttons_spec.rb b/spec/features/projects/tags/download_buttons_spec.rb index 64141cf5dc9..0f1f72fd039 100644 --- a/spec/features/projects/tags/download_buttons_spec.rb +++ b/spec/features/projects/tags/download_buttons_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Download buttons in tags page' do +RSpec.describe 'Download buttons in tags page' do let(:user) { create(:user) } let(:role) { :developer } let(:status) { 'success' } diff --git a/spec/features/projects/tags/user_edits_tags_spec.rb b/spec/features/projects/tags/user_edits_tags_spec.rb index 6388875a619..7a8a685f3d9 100644 --- a/spec/features/projects/tags/user_edits_tags_spec.rb +++ b/spec/features/projects/tags/user_edits_tags_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project > Tags', :js do +RSpec.describe 'Project > Tags', :js do include DropzoneHelper let(:user) { create(:user) } diff --git a/spec/features/projects/tags/user_views_tags_spec.rb b/spec/features/projects/tags/user_views_tags_spec.rb index 7b49b0d0f65..ef363ab6158 100644 --- a/spec/features/projects/tags/user_views_tags_spec.rb +++ b/spec/features/projects/tags/user_views_tags_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe 'User views tags', :feature do +RSpec.describe 'User views tags', :feature do context 'rss' do shared_examples 'has access to the tags RSS feed' do it do diff --git a/spec/features/projects/tree/create_directory_spec.rb b/spec/features/projects/tree/create_directory_spec.rb index 829b01832df..54b081161e5 100644 --- a/spec/features/projects/tree/create_directory_spec.rb +++ b/spec/features/projects/tree/create_directory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multi-file editor new directory', :js do +RSpec.describe 'Multi-file editor new directory', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/tree/create_file_spec.rb b/spec/features/projects/tree/create_file_spec.rb index 58ff623c9ae..cefb84e6f5e 100644 --- a/spec/features/projects/tree/create_file_spec.rb +++ b/spec/features/projects/tree/create_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multi-file editor new file', :js do +RSpec.describe 'Multi-file editor new file', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/tree/rss_spec.rb b/spec/features/projects/tree/rss_spec.rb index 4300574210f..efbfc329c9f 100644 --- a/spec/features/projects/tree/rss_spec.rb +++ b/spec/features/projects/tree/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project Tree RSS' do +RSpec.describe 'Project Tree RSS' do let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_tree_path(project, :master) } diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb index 2407a9e6ea3..388fa39874d 100644 --- a/spec/features/projects/tree/tree_show_spec.rb +++ b/spec/features/projects/tree/tree_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects tree', :js do +RSpec.describe 'Projects tree', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:gravatar_enabled) { true } @@ -24,7 +24,7 @@ describe 'Projects tree', :js do expect(page).to have_selector('.tree-item') expect(page).to have_content('add tests for .gitattributes custom highlighting') expect(page).not_to have_selector('.flash-alert') - expect(page).not_to have_selector('.label-lfs', text: 'LFS') + expect(page).not_to have_selector('[data-qa-selector="label-lfs"]', text: 'LFS') end it 'renders tree table for a subtree without errors' do @@ -33,7 +33,7 @@ describe 'Projects tree', :js do expect(page).to have_selector('.tree-item') expect(page).to have_content('add spaces in whitespace file') - expect(page).not_to have_selector('.label-lfs', text: 'LFS') + expect(page).not_to have_selector('[data-qa-selector="label-lfs"]', text: 'LFS') expect(page).not_to have_selector('.flash-alert') end @@ -86,7 +86,7 @@ describe 'Projects tree', :js do it 'renders LFS badge on blob item' do visit project_tree_path(project, File.join('master', 'files/lfs')) - expect(page).to have_selector('.label-lfs', text: 'LFS') + expect(page).to have_selector('[data-qa-selector="label-lfs"]', text: 'LFS') end end diff --git a/spec/features/projects/tree/upload_file_spec.rb b/spec/features/projects/tree/upload_file_spec.rb index 38c29263b1e..ce00483bc91 100644 --- a/spec/features/projects/tree/upload_file_spec.rb +++ b/spec/features/projects/tree/upload_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Multi-file editor upload file', :js do +RSpec.describe 'Multi-file editor upload file', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:txt_file) { File.join(Rails.root, 'spec', 'fixtures', 'doc_sample.txt') } diff --git a/spec/features/projects/user_changes_project_visibility_spec.rb b/spec/features/projects/user_changes_project_visibility_spec.rb index 31da4140d35..6935ad4be02 100644 --- a/spec/features/projects/user_changes_project_visibility_spec.rb +++ b/spec/features/projects/user_changes_project_visibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User changes public project visibility', :js do +RSpec.describe 'User changes public project visibility', :js do include ProjectForksHelper before do diff --git a/spec/features/projects/user_creates_project_spec.rb b/spec/features/projects/user_creates_project_spec.rb index 361367f1a3d..b204ae76e07 100644 --- a/spec/features/projects/user_creates_project_spec.rb +++ b/spec/features/projects/user_creates_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User creates a project', :js do +RSpec.describe 'User creates a project', :js do let(:user) { create(:user) } before do diff --git a/spec/features/projects/user_sees_sidebar_spec.rb b/spec/features/projects/user_sees_sidebar_spec.rb index 4226cdcc759..cc2a9eacbad 100644 --- a/spec/features/projects/user_sees_sidebar_spec.rb +++ b/spec/features/projects/user_sees_sidebar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > User sees sidebar' do +RSpec.describe 'Projects > User sees sidebar' do let(:user) { create(:user) } let(:project) { create(:project, :private, public_builds: false, namespace: user.namespace) } diff --git a/spec/features/projects/user_sees_user_popover_spec.rb b/spec/features/projects/user_sees_user_popover_spec.rb index 6197460776d..851ce79e1c6 100644 --- a/spec/features/projects/user_sees_user_popover_spec.rb +++ b/spec/features/projects/user_sees_user_popover_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User sees user popover', :js do +RSpec.describe 'User sees user popover', :js do include Spec::Support::Helpers::Features::NotesHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/features/projects/user_uses_shortcuts_spec.rb b/spec/features/projects/user_uses_shortcuts_spec.rb index 2d629ef538a..8fa5f741a95 100644 --- a/spec/features/projects/user_uses_shortcuts_spec.rb +++ b/spec/features/projects/user_uses_shortcuts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uses shortcuts', :js do +RSpec.describe 'User uses shortcuts', :js do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/projects/user_views_empty_project_spec.rb b/spec/features/projects/user_views_empty_project_spec.rb index cb6b63d4dd5..9202d18b86f 100644 --- a/spec/features/projects/user_views_empty_project_spec.rb +++ b/spec/features/projects/user_views_empty_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views an empty project' do +RSpec.describe 'User views an empty project' do let(:project) { create(:project, :empty_repo) } let(:user) { create(:user) } diff --git a/spec/features/projects/view_on_env_spec.rb b/spec/features/projects/view_on_env_spec.rb index 845c7b89a71..6f78f888c12 100644 --- a/spec/features/projects/view_on_env_spec.rb +++ b/spec/features/projects/view_on_env_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'View on environment', :js do +RSpec.describe 'View on environment', :js do let(:branch_name) { 'feature' } let(:file_path) { 'files/ruby/feature.rb' } let(:project) { create(:project, :repository) } diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index bc567d4db42..8eba2c98595 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Wiki > User previews markdown changes', :js do +RSpec.describe 'Projects > Wiki > User previews markdown changes', :js do let_it_be(:user) { create(:user) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, title: 'home', content: '[some link](other-page)') } diff --git a/spec/features/projects/wiki/shortcuts_spec.rb b/spec/features/projects/wiki/shortcuts_spec.rb index c51af2526c9..170e7afb51f 100644 --- a/spec/features/projects/wiki/shortcuts_spec.rb +++ b/spec/features/projects/wiki/shortcuts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Wiki shortcuts', :js do +RSpec.describe 'Wiki shortcuts', :js do let(:user) { create(:user) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, title: 'home', content: 'Home page') } diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index 5678ebcb72a..eba1b63765a 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "User creates wiki page" do +RSpec.describe "User creates wiki page" do include WikiHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/wiki/user_deletes_wiki_page_spec.rb b/spec/features/projects/wiki/user_deletes_wiki_page_spec.rb index 38e5e292064..a5d865d581b 100644 --- a/spec/features/projects/wiki/user_deletes_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_deletes_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User deletes wiki page', :js do +RSpec.describe 'User deletes wiki page', :js do let(:user) { create(:user) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki) } diff --git a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb index 6c6af1c41d2..83679c6bd1d 100644 --- a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Wiki > User views Git access wiki page' do +RSpec.describe 'Projects > Wiki > User views Git access wiki page' do let(:user) { create(:user) } let(:project) { create(:project, :wiki_repo, :public) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, title: 'home', content: '[some link](other-page)') } diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index 55509ddfa10..05d8989d88a 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User updates wiki page' do +RSpec.describe 'User updates wiki page' do include WikiHelpers let(:user) { create(:user) } @@ -29,7 +29,7 @@ describe 'User updates wiki page' do click_on('Cancel') end - expect(current_path).to eq project_wiki_path(project, :home) + expect(current_path).to eq wiki_path(project.wiki) end it 'updates a page that has a path', :js do diff --git a/spec/features/projects/wiki/user_views_wiki_empty_spec.rb b/spec/features/projects/wiki/user_views_wiki_empty_spec.rb index ab0f9b750d2..d9f79162c19 100644 --- a/spec/features/projects/wiki/user_views_wiki_empty_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_empty_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views empty wiki' do +RSpec.describe 'User views empty wiki' do let(:user) { create(:user) } shared_examples 'empty wiki and accessible issues' do @@ -12,6 +12,8 @@ describe 'User views empty wiki' do element = page.find('.row.empty-state') expect(element).to have_content('This project has no wiki pages') + expect(element).to have_content('You must be a project member') + expect(element).to have_content('improve the wiki for this project') expect(element).to have_link("issue tracker", href: project_issues_path(project)) expect(element).to have_link("Suggest wiki improvement", href: new_project_issue_path(project)) end @@ -24,6 +26,7 @@ describe 'User views empty wiki' do element = page.find('.row.empty-state') expect(element).to have_content('This project has no wiki pages') + expect(element).to have_content('You must be a project member') expect(element).to have_no_link('Suggest wiki improvement') end end @@ -66,9 +69,10 @@ describe 'User views empty wiki' do it 'show "create first page" message' do visit(project_wikis_path(project)) - element = page.find('.row.empty-state') + expect(element).to have_content('your project', count: 2) + element.click_link 'Create your first page' expect(page).to have_button('Create page') diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb index cb425e8b704..30b94495e3d 100644 --- a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Projects > Wiki > User views wiki in project page' do +RSpec.describe 'Projects > Wiki > User views wiki in project page' do let(:user) { create(:user) } before do diff --git a/spec/features/projects/wiki/user_views_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_page_spec.rb index e379e7466db..59ccb83a9bb 100644 --- a/spec/features/projects/wiki/user_views_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views a wiki page' do +RSpec.describe 'User views a wiki page' do include WikiHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/wiki/user_views_wiki_pages_spec.rb b/spec/features/projects/wiki/user_views_wiki_pages_spec.rb index 584b2a76143..fea913b8212 100644 --- a/spec/features/projects/wiki/user_views_wiki_pages_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views wiki pages' do +RSpec.describe 'User views wiki pages' do include WikiHelpers let(:user) { create(:user) } diff --git a/spec/features/projects/wiki/users_views_asciidoc_page_with_includes_spec.rb b/spec/features/projects/wiki/users_views_asciidoc_page_with_includes_spec.rb index 014b63fa154..5c45e34595f 100644 --- a/spec/features/projects/wiki/users_views_asciidoc_page_with_includes_spec.rb +++ b/spec/features/projects/wiki/users_views_asciidoc_page_with_includes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User views AsciiDoc page with includes', :js do +RSpec.describe 'User views AsciiDoc page with includes', :js do let_it_be(:user) { create(:user) } let_it_be(:wiki_content_selector) { '[data-qa-selector=wiki_page_content]' } let(:project) { create(:project, :public, :wiki_repo) } diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 47f32e0113c..ab0b6725491 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Project' do +RSpec.describe 'Project' do include ProjectForksHelper include MobileHelpers diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb index 36c5a116b66..f0707610c3f 100644 --- a/spec/features/protected_branches_spec.rb +++ b/spec/features/protected_branches_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Protected Branches', :js do +RSpec.describe 'Protected Branches', :js do include ProtectedBranchHelpers let(:user) { create(:user) } diff --git a/spec/features/protected_tags_spec.rb b/spec/features/protected_tags_spec.rb index 3322a747cf5..12e4bbde293 100644 --- a/spec/features/protected_tags_spec.rb +++ b/spec/features/protected_tags_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Protected Tags', :js do +RSpec.describe 'Protected Tags', :js do include ProtectedTagHelpers let(:user) { create(:user, :admin) } diff --git a/spec/features/read_only_spec.rb b/spec/features/read_only_spec.rb index a33535a7b0b..eb043d2193a 100644 --- a/spec/features/read_only_spec.rb +++ b/spec/features/read_only_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'read-only message' do +RSpec.describe 'read-only message' do let_it_be(:user) { create(:user) } before do diff --git a/spec/features/reportable_note/commit_spec.rb b/spec/features/reportable_note/commit_spec.rb index 3502401095e..fc0df9d6113 100644 --- a/spec/features/reportable_note/commit_spec.rb +++ b/spec/features/reportable_note/commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Reportable note on commit', :js do +RSpec.describe 'Reportable note on commit', :js do include RepoHelpers let(:user) { create(:user) } diff --git a/spec/features/reportable_note/issue_spec.rb b/spec/features/reportable_note/issue_spec.rb index c45ef77df55..80c321d0f5a 100644 --- a/spec/features/reportable_note/issue_spec.rb +++ b/spec/features/reportable_note/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Reportable note on issue', :js do +RSpec.describe 'Reportable note on issue', :js do let(:user) { create(:user) } let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/reportable_note/merge_request_spec.rb b/spec/features/reportable_note/merge_request_spec.rb index 2e4d032754b..58a39bac707 100644 --- a/spec/features/reportable_note/merge_request_spec.rb +++ b/spec/features/reportable_note/merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Reportable note on merge request', :js do +RSpec.describe 'Reportable note on merge request', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/reportable_note/snippets_spec.rb b/spec/features/reportable_note/snippets_spec.rb index a4e609ce40c..4d61e5d8285 100644 --- a/spec/features/reportable_note/snippets_spec.rb +++ b/spec/features/reportable_note/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Reportable note on snippets', :js do +RSpec.describe 'Reportable note on snippets', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb index 0049d3ca7c9..8806a363ca4 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Runners' do +RSpec.describe 'Runners' do let(:user) { create(:user) } before do diff --git a/spec/features/search/user_searches_for_code_spec.rb b/spec/features/search/user_searches_for_code_spec.rb index 0fdc7346535..227e75088d2 100644 --- a/spec/features/search/user_searches_for_code_spec.rb +++ b/spec/features/search/user_searches_for_code_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for code' do +RSpec.describe 'User searches for code' do let(:user) { create(:user) } let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/features/search/user_searches_for_comments_spec.rb b/spec/features/search/user_searches_for_comments_spec.rb index 0a203a5bf2d..2a12b22b457 100644 --- a/spec/features/search/user_searches_for_comments_spec.rb +++ b/spec/features/search/user_searches_for_comments_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for comments' do +RSpec.describe 'User searches for comments' do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/features/search/user_searches_for_commits_spec.rb b/spec/features/search/user_searches_for_commits_spec.rb index 958f12d3b84..b860cd08e64 100644 --- a/spec/features/search/user_searches_for_commits_spec.rb +++ b/spec/features/search/user_searches_for_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for commits' do +RSpec.describe 'User searches for commits' do let(:project) { create(:project, :repository) } let(:sha) { '6d394385cf567f80a8fd85055db1ab4c5295806f' } let(:user) { create(:user) } diff --git a/spec/features/search/user_searches_for_issues_spec.rb b/spec/features/search/user_searches_for_issues_spec.rb index ae718cec7af..e9943347522 100644 --- a/spec/features/search/user_searches_for_issues_spec.rb +++ b/spec/features/search/user_searches_for_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for issues', :js do +RSpec.describe 'User searches for issues', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let!(:issue1) { create(:issue, title: 'Foo', project: project) } diff --git a/spec/features/search/user_searches_for_merge_requests_spec.rb b/spec/features/search/user_searches_for_merge_requests_spec.rb index 0139ac26816..40583664958 100644 --- a/spec/features/search/user_searches_for_merge_requests_spec.rb +++ b/spec/features/search/user_searches_for_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for merge requests', :js do +RSpec.describe 'User searches for merge requests', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let!(:merge_request1) { create(:merge_request, title: 'Foo', source_project: project, target_project: project) } diff --git a/spec/features/search/user_searches_for_milestones_spec.rb b/spec/features/search/user_searches_for_milestones_spec.rb index 0714cfcc309..64e756db180 100644 --- a/spec/features/search/user_searches_for_milestones_spec.rb +++ b/spec/features/search/user_searches_for_milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for milestones', :js do +RSpec.describe 'User searches for milestones', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let!(:milestone1) { create(:milestone, title: 'Foo', project: project) } diff --git a/spec/features/search/user_searches_for_projects_spec.rb b/spec/features/search/user_searches_for_projects_spec.rb index b194ac32ff6..7bb5a4da7d0 100644 --- a/spec/features/search/user_searches_for_projects_spec.rb +++ b/spec/features/search/user_searches_for_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for projects' do +RSpec.describe 'User searches for projects' do let!(:project) { create(:project, :public, name: 'Shop') } context 'when signed out' do diff --git a/spec/features/search/user_searches_for_users_spec.rb b/spec/features/search/user_searches_for_users_spec.rb index 6f2c5d48018..826ed73c9bf 100644 --- a/spec/features/search/user_searches_for_users_spec.rb +++ b/spec/features/search/user_searches_for_users_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for users' do +RSpec.describe 'User searches for users' do let(:user1) { create(:user, username: 'gob_bluth', name: 'Gob Bluth') } let(:user2) { create(:user, username: 'michael_bluth', name: 'Michael Bluth') } let(:user3) { create(:user, username: 'gob_2018', name: 'George Oscar Bluth') } diff --git a/spec/features/search/user_searches_for_wiki_pages_spec.rb b/spec/features/search/user_searches_for_wiki_pages_spec.rb index 10c3032da8b..fc60b6244d9 100644 --- a/spec/features/search/user_searches_for_wiki_pages_spec.rb +++ b/spec/features/search/user_searches_for_wiki_pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User searches for wiki pages', :js do +RSpec.describe 'User searches for wiki pages', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository, :wiki_repo, namespace: user.namespace) } let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, title: 'directory/title', content: 'Some Wiki content') } diff --git a/spec/features/search/user_uses_header_search_field_spec.rb b/spec/features/search/user_uses_header_search_field_spec.rb index 7b969aea547..5567dcb30ec 100644 --- a/spec/features/search/user_uses_header_search_field_spec.rb +++ b/spec/features/search/user_uses_header_search_field_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uses header search field', :js do +RSpec.describe 'User uses header search field', :js do include FilteredSearchHelpers let(:project) { create(:project) } @@ -95,14 +95,6 @@ describe 'User uses header search field', :js do expect(page).not_to have_selector('.dropdown-header', text: /#{scope_name}/i) end - - it 'hides the dropdown when there are no results' do - page.within('.search-input-wrap') do - fill_in('search', with: 'a_search_term_with_no_results') - end - - expect(page).not_to have_selector('.dropdown-menu') - end end end diff --git a/spec/features/search/user_uses_search_filters_spec.rb b/spec/features/search/user_uses_search_filters_spec.rb index fbd7da3c643..f39a1f8fe37 100644 --- a/spec/features/search/user_uses_search_filters_spec.rb +++ b/spec/features/search/user_uses_search_filters_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uses search filters', :js do +RSpec.describe 'User uses search filters', :js do let(:group) { create(:group) } let!(:group_project) { create(:project, group: group) } let(:project) { create(:project, namespace: user.namespace) } diff --git a/spec/features/security/admin_access_spec.rb b/spec/features/security/admin_access_spec.rb index 9b2c873b2aa..38f00f399f3 100644 --- a/spec/features/security/admin_access_spec.rb +++ b/spec/features/security/admin_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::Projects" do +RSpec.describe "Admin::Projects" do include AccessMatchers describe "GET /admin/projects" do diff --git a/spec/features/security/dashboard_access_spec.rb b/spec/features/security/dashboard_access_spec.rb index 13fafd88a4c..5ac4a5c1840 100644 --- a/spec/features/security/dashboard_access_spec.rb +++ b/spec/features/security/dashboard_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Dashboard access" do +RSpec.describe "Dashboard access" do include AccessMatchers describe "GET /dashboard" do diff --git a/spec/features/security/group/internal_access_spec.rb b/spec/features/security/group/internal_access_spec.rb index 114bc1a1f0c..c146ac1e8ee 100644 --- a/spec/features/security/group/internal_access_spec.rb +++ b/spec/features/security/group/internal_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Internal Group access' do +RSpec.describe 'Internal Group access' do include AccessMatchers let(:group) { create(:group, :internal) } diff --git a/spec/features/security/group/private_access_spec.rb b/spec/features/security/group/private_access_spec.rb index 3362b9a9e9e..de05b4d3d16 100644 --- a/spec/features/security/group/private_access_spec.rb +++ b/spec/features/security/group/private_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Private Group access' do +RSpec.describe 'Private Group access' do include AccessMatchers let(:group) { create(:group, :private) } diff --git a/spec/features/security/group/public_access_spec.rb b/spec/features/security/group/public_access_spec.rb index bf05f276cc6..ee72b84616a 100644 --- a/spec/features/security/group/public_access_spec.rb +++ b/spec/features/security/group/public_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Public Group access' do +RSpec.describe 'Public Group access' do include AccessMatchers let(:group) { create(:group, :public) } diff --git a/spec/features/security/profile_access_spec.rb b/spec/features/security/profile_access_spec.rb index 044a47567be..3aa8278866c 100644 --- a/spec/features/security/profile_access_spec.rb +++ b/spec/features/security/profile_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Profile access" do +RSpec.describe "Profile access" do include AccessMatchers describe "GET /profile/keys" do diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb index f29aa8de928..99f30d2f904 100644 --- a/spec/features/security/project/internal_access_spec.rb +++ b/spec/features/security/project/internal_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Internal Project Access" do +RSpec.describe "Internal Project Access" do include AccessMatchers let_it_be(:project, reload: true) { create(:project, :internal, :repository) } @@ -85,8 +85,8 @@ describe "Internal Project Access" do it { is_expected.to be_denied_for(:visitor) } end - describe "GET /:project_path/-/settings/members" do - subject { project_settings_members_path(project) } + describe "GET /:project_path/-/project_members" do + subject { project_project_members_path(project) } it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:owner).of(project) } diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index ac8596d89bc..e891e79db70 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Private Project Access" do +RSpec.describe "Private Project Access" do include AccessMatchers let_it_be(:project, reload: true) { create(:project, :private, :repository, public_builds: false) } @@ -85,8 +85,8 @@ describe "Private Project Access" do it { is_expected.to be_denied_for(:visitor) } end - describe "GET /:project_path/-/settings/members" do - subject { project_settings_members_path(project) } + describe "GET /:project_path/-/project_members" do + subject { project_project_members_path(project) } it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:owner).of(project) } diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb index 11e9bff10a1..ea00a59dee4 100644 --- a/spec/features/security/project/public_access_spec.rb +++ b/spec/features/security/project/public_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Public Project Access" do +RSpec.describe "Public Project Access" do include AccessMatchers let_it_be(:project, reload: true) { create(:project, :public, :repository) } @@ -85,8 +85,8 @@ describe "Public Project Access" do it { is_expected.to be_allowed_for(:visitor) } end - describe "GET /:project_path/-/settings/members" do - subject { project_settings_members_path(project) } + describe "GET /:project_path/-/project_members" do + subject { project_project_members_path(project) } it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:owner).of(project) } diff --git a/spec/features/security/project/snippet/internal_access_spec.rb b/spec/features/security/project/snippet/internal_access_spec.rb index 4b6c7d2c8fb..52ae1022a4e 100644 --- a/spec/features/security/project/snippet/internal_access_spec.rb +++ b/spec/features/security/project/snippet/internal_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Internal Project Snippets Access" do +RSpec.describe "Internal Project Snippets Access" do include AccessMatchers let(:project) { create(:project, :internal) } diff --git a/spec/features/security/project/snippet/private_access_spec.rb b/spec/features/security/project/snippet/private_access_spec.rb index 3135d25cc10..0c97b012ad1 100644 --- a/spec/features/security/project/snippet/private_access_spec.rb +++ b/spec/features/security/project/snippet/private_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Private Project Snippets Access" do +RSpec.describe "Private Project Snippets Access" do include AccessMatchers let(:project) { create(:project, :private) } diff --git a/spec/features/security/project/snippet/public_access_spec.rb b/spec/features/security/project/snippet/public_access_spec.rb index 81689a7bcb5..dfe78aa7ebc 100644 --- a/spec/features/security/project/snippet/public_access_spec.rb +++ b/spec/features/security/project/snippet/public_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Public Project Snippets Access" do +RSpec.describe "Public Project Snippets Access" do include AccessMatchers let(:project) { create(:project, :public) } diff --git a/spec/features/sentry_js_spec.rb b/spec/features/sentry_js_spec.rb index b39c4f0a0ae..1d277ba7b3c 100644 --- a/spec/features/sentry_js_spec.rb +++ b/spec/features/sentry_js_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' -describe 'Sentry' do - let(:sentry_path) { '/sentry.chunk.js' } +RSpec.describe 'Sentry' do + let(:sentry_regex_path) { '\/sentry.*\.chunk\.js' } it 'does not load sentry if sentry is disabled' do allow(Gitlab.config.sentry).to receive(:enabled).and_return(false) @@ -22,7 +22,7 @@ describe 'Sentry' do def has_requested_sentry page.all('script', visible: false).one? do |elm| - elm[:src] =~ /#{sentry_path}$/ + elm[:src] =~ /#{sentry_regex_path}$/ end end end diff --git a/spec/features/signed_commits_spec.rb b/spec/features/signed_commits_spec.rb index 3c7a31ac11b..04ca8a09ca8 100644 --- a/spec/features/signed_commits_spec.rb +++ b/spec/features/signed_commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'GPG signed commits' do +RSpec.describe 'GPG signed commits' do let(:project) { create(:project, :public, :repository) } it 'changes from unverified to verified when the user changes their email to match the gpg key', :sidekiq_might_not_need_inline do diff --git a/spec/features/snippets/embedded_snippet_spec.rb b/spec/features/snippets/embedded_snippet_spec.rb index d6275b5a265..4f2ab598a6f 100644 --- a/spec/features/snippets/embedded_snippet_spec.rb +++ b/spec/features/snippets/embedded_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Embedded Snippets' do +RSpec.describe 'Embedded Snippets' do let(:snippet) { create(:personal_snippet, :public, file_name: 'random_dir.rb', content: content) } let(:content) { "require 'fileutils'\nFileUtils.mkdir_p 'some/random_dir'\n" } diff --git a/spec/features/snippets/explore_spec.rb b/spec/features/snippets/explore_spec.rb index 2075742eafb..b62c35bf96e 100644 --- a/spec/features/snippets/explore_spec.rb +++ b/spec/features/snippets/explore_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Explore Snippets' do +RSpec.describe 'Explore Snippets' do let!(:public_snippet) { create(:personal_snippet, :public) } let!(:internal_snippet) { create(:personal_snippet, :internal) } let!(:private_snippet) { create(:personal_snippet, :private) } diff --git a/spec/features/snippets/internal_snippet_spec.rb b/spec/features/snippets/internal_snippet_spec.rb index fd7ef71db15..3ce297ab22d 100644 --- a/spec/features/snippets/internal_snippet_spec.rb +++ b/spec/features/snippets/internal_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Internal Snippets', :js do +RSpec.describe 'Internal Snippets', :js do let(:internal_snippet) { create(:personal_snippet, :internal) } before do diff --git a/spec/features/snippets/notes_on_personal_snippets_spec.rb b/spec/features/snippets/notes_on_personal_snippets_spec.rb index 57264f97ddc..aaaa61fec62 100644 --- a/spec/features/snippets/notes_on_personal_snippets_spec.rb +++ b/spec/features/snippets/notes_on_personal_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Comments on personal snippets', :js do +RSpec.describe 'Comments on personal snippets', :js do include NoteInteractionHelpers let!(:user) { create(:user) } diff --git a/spec/features/snippets/private_snippets_spec.rb b/spec/features/snippets/private_snippets_spec.rb index 37f45f22a27..6b45f3485e7 100644 --- a/spec/features/snippets/private_snippets_spec.rb +++ b/spec/features/snippets/private_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Private Snippets', :js do +RSpec.describe 'Private Snippets', :js do let(:user) { create(:user) } before do diff --git a/spec/features/snippets/public_snippets_spec.rb b/spec/features/snippets/public_snippets_spec.rb index 295e61ffb56..4b72b33245d 100644 --- a/spec/features/snippets/public_snippets_spec.rb +++ b/spec/features/snippets/public_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Public Snippets', :js do +RSpec.describe 'Public Snippets', :js do before do stub_feature_flags(snippets_vue: false) end diff --git a/spec/features/snippets/search_snippets_spec.rb b/spec/features/snippets/search_snippets_spec.rb index d3e02d43813..4f299edc9da 100644 --- a/spec/features/snippets/search_snippets_spec.rb +++ b/spec/features/snippets/search_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Search Snippets' do +RSpec.describe 'Search Snippets' do it 'User searches for snippets by title' do public_snippet = create(:personal_snippet, :public, title: 'Beginning and Middle') private_snippet = create(:personal_snippet, :private, title: 'Middle and End') diff --git a/spec/features/snippets/show_spec.rb b/spec/features/snippets/show_spec.rb index 9c686be012b..9125ed74273 100644 --- a/spec/features/snippets/show_spec.rb +++ b/spec/features/snippets/show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Snippet', :js do +RSpec.describe 'Snippet', :js do let(:project) { create(:project, :repository) } let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content) } diff --git a/spec/features/snippets/spam_snippets_spec.rb b/spec/features/snippets/spam_snippets_spec.rb index d7b181dc678..e6a9467a3d7 100644 --- a/spec/features/snippets/spam_snippets_spec.rb +++ b/spec/features/snippets/spam_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples_for 'snippet editor' do +RSpec.shared_examples_for 'snippet editor' do include_context 'includes Spam constants' def description_field @@ -68,7 +68,7 @@ shared_examples_for 'snippet editor' do context 'when SpamVerdictService requires recaptcha' do before do expect_next_instance_of(Spam::SpamVerdictService) do |verdict_service| - expect(verdict_service).to receive(:execute).and_return(REQUIRE_RECAPTCHA) + expect(verdict_service).to receive(:execute).and_return(CONDITIONAL_ALLOW) end end @@ -122,7 +122,7 @@ shared_examples_for 'snippet editor' do end end -describe 'User creates snippet', :js do +RSpec.describe 'User creates snippet', :js do let_it_be(:user) { create(:user) } it_behaves_like "snippet editor" diff --git a/spec/features/snippets/user_creates_snippet_spec.rb b/spec/features/snippets/user_creates_snippet_spec.rb index 62054c1f491..b100e035d38 100644 --- a/spec/features/snippets/user_creates_snippet_spec.rb +++ b/spec/features/snippets/user_creates_snippet_spec.rb @@ -2,12 +2,11 @@ require 'spec_helper' -shared_examples_for 'snippet editor' do +RSpec.shared_examples_for 'snippet editor' do before do stub_feature_flags(snippets_vue: false) stub_feature_flags(snippets_edit_vue: false) sign_in(user) - visit new_snippet_path end def description_field @@ -28,6 +27,8 @@ shared_examples_for 'snippet editor' do end it 'Authenticated user creates a snippet' do + visit new_snippet_path + fill_form click_button('Create snippet') @@ -42,6 +43,8 @@ shared_examples_for 'snippet editor' do end it 'previews a snippet with file' do + visit new_snippet_path + # Click placeholder first to expand full description field description_field.click fill_in 'personal_snippet_description', with: 'My Snippet' @@ -62,6 +65,8 @@ shared_examples_for 'snippet editor' do end it 'uploads a file when dragging into textarea' do + visit new_snippet_path + fill_form dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif') @@ -86,6 +91,8 @@ shared_examples_for 'snippet editor' do allow(instance).to receive(:create_commit).and_raise(StandardError, error) end + visit new_snippet_path + fill_form click_button('Create snippet') @@ -107,6 +114,8 @@ shared_examples_for 'snippet editor' do end it 'validation fails for the first time' do + visit new_snippet_path + fill_in 'personal_snippet_title', with: 'My Snippet Title' click_button('Create snippet') @@ -132,6 +141,8 @@ shared_examples_for 'snippet editor' do end it 'Authenticated user creates a snippet with + in filename' do + visit new_snippet_path + fill_in 'personal_snippet_title', with: 'My Snippet Title' page.within('.file-editor') do find(:xpath, "//input[@id='personal_snippet_file_name']").set 'snippet+file+name' @@ -146,9 +157,32 @@ shared_examples_for 'snippet editor' do expect(page).to have_content('snippet+file+name') expect(page).to have_content('Hello World!') end + + context 'when snippets default visibility level is restricted' do + before do + stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::PRIVATE], + default_snippet_visibility: Gitlab::VisibilityLevel::PRIVATE) + end + + it 'creates a snippet using the lowest available visibility level as default' do + visit new_snippet_path + + fill_form + + click_button('Create snippet') + wait_for_requests + + visit snippets_path + click_link('Internal') + + expect(page).to have_content('My Snippet Title') + created_snippet = Snippet.last + expect(created_snippet.visibility_level).to eq(Gitlab::VisibilityLevel::INTERNAL) + end + end end -describe 'User creates snippet', :js do +RSpec.describe 'User creates snippet', :js do include DropzoneHelper let_it_be(:user) { create(:user) } diff --git a/spec/features/snippets/user_deletes_snippet_spec.rb b/spec/features/snippets/user_deletes_snippet_spec.rb index 35619b92561..d7cfc67df13 100644 --- a/spec/features/snippets/user_deletes_snippet_spec.rb +++ b/spec/features/snippets/user_deletes_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User deletes snippet' do +RSpec.describe 'User deletes snippet' do let(:user) { create(:user) } let(:content) { 'puts "test"' } let(:snippet) { create(:personal_snippet, :public, content: content, author: user) } diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index 40b0113cf39..3692b0d1ad8 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User edits snippet', :js do +RSpec.describe 'User edits snippet', :js do include DropzoneHelper let_it_be(:file_name) { 'test.rb' } diff --git a/spec/features/snippets/user_snippets_spec.rb b/spec/features/snippets/user_snippets_spec.rb index d9faea55b29..a313dc3b26a 100644 --- a/spec/features/snippets/user_snippets_spec.rb +++ b/spec/features/snippets/user_snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User Snippets' do +RSpec.describe 'User Snippets' do let(:author) { create(:user) } let!(:public_snippet) { create(:personal_snippet, :public, author: author, title: "This is a public snippet") } let!(:internal_snippet) { create(:personal_snippet, :internal, author: author, title: "This is an internal snippet") } diff --git a/spec/features/snippets_spec.rb b/spec/features/snippets_spec.rb index bc7fa161e87..75309ca3e7c 100644 --- a/spec/features/snippets_spec.rb +++ b/spec/features/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Snippets' do +RSpec.describe 'Snippets' do context 'when the project has snippets' do let(:project) { create(:project, :public) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } diff --git a/spec/features/static_site_editor_spec.rb b/spec/features/static_site_editor_spec.rb index de000ee2b9f..9ae23b4bdec 100644 --- a/spec/features/static_site_editor_spec.rb +++ b/spec/features/static_site_editor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Static Site Editor' do +RSpec.describe 'Static Site Editor' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :public, :repository) } diff --git a/spec/features/tags/developer_creates_tag_spec.rb b/spec/features/tags/developer_creates_tag_spec.rb index a2d53b04c9d..f982d403ce1 100644 --- a/spec/features/tags/developer_creates_tag_spec.rb +++ b/spec/features/tags/developer_creates_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Developer creates tag' do +RSpec.describe 'Developer creates tag' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } diff --git a/spec/features/tags/developer_deletes_tag_spec.rb b/spec/features/tags/developer_deletes_tag_spec.rb index 50eac8ddaed..de9296bc08e 100644 --- a/spec/features/tags/developer_deletes_tag_spec.rb +++ b/spec/features/tags/developer_deletes_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Developer deletes tag' do +RSpec.describe 'Developer deletes tag' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } diff --git a/spec/features/tags/developer_updates_tag_spec.rb b/spec/features/tags/developer_updates_tag_spec.rb index 167079c3f31..93a275131bd 100644 --- a/spec/features/tags/developer_updates_tag_spec.rb +++ b/spec/features/tags/developer_updates_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Developer updates tag' do +RSpec.describe 'Developer updates tag' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } diff --git a/spec/features/tags/developer_views_tags_spec.rb b/spec/features/tags/developer_views_tags_spec.rb index b892b2b4d12..4888611472c 100644 --- a/spec/features/tags/developer_views_tags_spec.rb +++ b/spec/features/tags/developer_views_tags_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Developer views tags' do +RSpec.describe 'Developer views tags' do let(:user) { create(:user) } let(:group) { create(:group) } diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb index 24a183017c9..fa87c4bb1c4 100644 --- a/spec/features/task_lists_spec.rb +++ b/spec/features/task_lists_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Task Lists' do +RSpec.describe 'Task Lists' do include Warden::Test::Helpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb index af406961bbc..577134fe722 100644 --- a/spec/features/triggers_spec.rb +++ b/spec/features/triggers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Triggers', :js do +RSpec.describe 'Triggers', :js do let(:trigger_title) { 'trigger desc' } let(:user) { create(:user) } let(:user2) { create(:user) } diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb index bb18703f90e..8dbedc0a7ee 100644 --- a/spec/features/u2f_spec.rb +++ b/spec/features/u2f_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do +RSpec.describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do def manage_two_factor_authentication click_on 'Manage two-factor authentication' expect(page).to have_content("Set up new U2F device") @@ -257,7 +257,7 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do expect(page).to have_button('Verify code') expect(page).to have_css('#user_otp_attempt') expect(page).not_to have_link('Sign in via 2FA code') - expect(page).not_to have_css('#js-authenticate-u2f') + expect(page).not_to have_css('#js-authenticate-token-2fa') end before do diff --git a/spec/features/unsubscribe_links_spec.rb b/spec/features/unsubscribe_links_spec.rb index cf30776786b..966d90ab16b 100644 --- a/spec/features/unsubscribe_links_spec.rb +++ b/spec/features/unsubscribe_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Unsubscribe links', :sidekiq_might_not_need_inline do +RSpec.describe 'Unsubscribe links', :sidekiq_might_not_need_inline do include Warden::Test::Helpers let(:recipient) { create(:user) } diff --git a/spec/features/uploads/user_uploads_avatar_to_group_spec.rb b/spec/features/uploads/user_uploads_avatar_to_group_spec.rb index d9d9d7e4b04..8daa869a6e3 100644 --- a/spec/features/uploads/user_uploads_avatar_to_group_spec.rb +++ b/spec/features/uploads/user_uploads_avatar_to_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uploads avatar to group' do +RSpec.describe 'User uploads avatar to group' do it 'they see the new avatar' do user = create(:user) group = create(:group) diff --git a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb index fc31d7aa3d1..31e29810c65 100644 --- a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb +++ b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uploads avatar to profile' do +RSpec.describe 'User uploads avatar to profile' do let!(:user) { create(:user) } let(:avatar_file_path) { Rails.root.join('spec', 'fixtures', 'dk.png') } diff --git a/spec/features/uploads/user_uploads_file_to_note_spec.rb b/spec/features/uploads/user_uploads_file_to_note_spec.rb index 570ecad41fa..7f55ddc1d64 100644 --- a/spec/features/uploads/user_uploads_file_to_note_spec.rb +++ b/spec/features/uploads/user_uploads_file_to_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User uploads file to note' do +RSpec.describe 'User uploads file to note' do include DropzoneHelper let(:user) { create(:user) } diff --git a/spec/features/usage_stats_consent_spec.rb b/spec/features/usage_stats_consent_spec.rb index 14232b1b370..04bdf25acc0 100644 --- a/spec/features/usage_stats_consent_spec.rb +++ b/spec/features/usage_stats_consent_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Usage stats consent' do +RSpec.describe 'Usage stats consent' do context 'when signed in' do let(:user) { create(:admin, created_at: 8.days.ago) } let(:message) { 'To help improve GitLab, we would like to periodically collect usage information.' } diff --git a/spec/features/user_can_display_performance_bar_spec.rb b/spec/features/user_can_display_performance_bar_spec.rb index 8b3f193f418..9c67523f88f 100644 --- a/spec/features/user_can_display_performance_bar_spec.rb +++ b/spec/features/user_can_display_performance_bar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User can display performance bar', :js do +RSpec.describe 'User can display performance bar', :js do shared_examples 'performance bar cannot be displayed' do it 'does not show the performance bar by default' do expect(page).not_to have_css('#js-peek') diff --git a/spec/features/user_opens_link_to_comment_spec.rb b/spec/features/user_opens_link_to_comment_spec.rb index 9533a4fe40d..ae84f69f432 100644 --- a/spec/features/user_opens_link_to_comment_spec.rb +++ b/spec/features/user_opens_link_to_comment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User opens link to comment', :js do +RSpec.describe 'User opens link to comment', :js do let(:project) { create(:project, :public) } let(:note) { create(:note_on_issue, project: project) } diff --git a/spec/features/user_sees_revert_modal_spec.rb b/spec/features/user_sees_revert_modal_spec.rb index c0cffe885de..331f51dad95 100644 --- a/spec/features/user_sees_revert_modal_spec.rb +++ b/spec/features/user_sees_revert_modal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline do +RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/user_sorts_things_spec.rb b/spec/features/user_sorts_things_spec.rb index 8397854df27..6eaa620b538 100644 --- a/spec/features/user_sorts_things_spec.rb +++ b/spec/features/user_sorts_things_spec.rb @@ -6,7 +6,7 @@ require "spec_helper" # to check if the sorting option set by user is being kept persisted while going through pages. # The `it`s are named here by convention `starting point -> some pages -> final point`. # All those specs are moved out to this spec intentionally to keep them all in one place. -describe "User sorts things" do +RSpec.describe "User sorts things" do include Spec::Support::Helpers::Features::SortingHelpers include DashboardHelper diff --git a/spec/features/users/active_sessions_spec.rb b/spec/features/users/active_sessions_spec.rb index c717e89eafb..8e2e16e555e 100644 --- a/spec/features/users/active_sessions_spec.rb +++ b/spec/features/users/active_sessions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Active user sessions', :clean_gitlab_redis_shared_state do +RSpec.describe 'Active user sessions', :clean_gitlab_redis_shared_state do it 'Successful login adds a new active user login' do now = Time.zone.parse('2018-03-12 09:06') Timecop.freeze(now) do diff --git a/spec/features/users/add_email_to_existing_account_spec.rb b/spec/features/users/add_email_to_existing_account_spec.rb index 42e352399a8..9130b96b0e3 100644 --- a/spec/features/users/add_email_to_existing_account_spec.rb +++ b/spec/features/users/add_email_to_existing_account_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'AdditionalEmailToExistingAccount' do +RSpec.describe 'AdditionalEmailToExistingAccount' do describe 'add secondary email associated with account' do let(:user) { create(:user) } diff --git a/spec/features/users/anonymous_sessions_spec.rb b/spec/features/users/anonymous_sessions_spec.rb index e87ee39a3f4..420fb225f94 100644 --- a/spec/features/users/anonymous_sessions_spec.rb +++ b/spec/features/users/anonymous_sessions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Session TTLs', :clean_gitlab_redis_shared_state do +RSpec.describe 'Session TTLs', :clean_gitlab_redis_shared_state do it 'creates a session with a short TTL when login fails' do visit new_user_session_path # The session key only gets created after a post diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index 5a8db3c070d..7ba663d08d4 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Login' do +RSpec.describe 'Login' do include TermsHelper include UserLoginHelper diff --git a/spec/features/users/logout_spec.rb b/spec/features/users/logout_spec.rb index a72a42c738d..ffb8785b277 100644 --- a/spec/features/users/logout_spec.rb +++ b/spec/features/users/logout_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Logout/Sign out', :js do +RSpec.describe 'Logout/Sign out', :js do let(:user) { create(:user) } before do diff --git a/spec/features/users/overview_spec.rb b/spec/features/users/overview_spec.rb index b3531d040e4..549087e5950 100644 --- a/spec/features/users/overview_spec.rb +++ b/spec/features/users/overview_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Overview tab on a user profile', :js do +RSpec.describe 'Overview tab on a user profile', :js do let(:user) { create(:user) } let(:contributed_project) { create(:project, :public, :repository) } diff --git a/spec/features/users/rss_spec.rb b/spec/features/users/rss_spec.rb index ecdbf032623..aba1ff63fab 100644 --- a/spec/features/users/rss_spec.rb +++ b/spec/features/users/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User RSS' do +RSpec.describe 'User RSS' do let(:user) { create(:user) } let(:path) { user_path(create(:user)) } diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb index a45389a7ed5..dd5c2442d00 100644 --- a/spec/features/users/show_spec.rb +++ b/spec/features/users/show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'User page' do +RSpec.describe 'User page' do include ExternalAuthorizationServiceHelpers let(:user) { create(:user) } diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb index 0ef86dde030..66a26493339 100644 --- a/spec/features/users/signup_spec.rb +++ b/spec/features/users/signup_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples 'Signup' do +RSpec.shared_examples 'Signup' do include TermsHelper let(:new_user) { build_stubbed(:user) } @@ -420,7 +420,7 @@ shared_examples 'Signup' do end end -shared_examples 'Signup name validation' do |field, max_length| +RSpec.shared_examples 'Signup name validation' do |field, max_length| before do visit new_user_registration_path end @@ -458,7 +458,7 @@ shared_examples 'Signup name validation' do |field, max_length| end end -describe 'With original flow' do +RSpec.describe 'With original flow' do before do stub_experiment(signup_flow: false) stub_experiment_for_user(signup_flow: false) @@ -468,7 +468,7 @@ describe 'With original flow' do it_behaves_like 'Signup name validation', 'new_user_name', 255 end -describe 'With experimental flow' do +RSpec.describe 'With experimental flow' do before do stub_experiment(signup_flow: true) stub_experiment_for_user(signup_flow: true) diff --git a/spec/features/users/snippets_spec.rb b/spec/features/users/snippets_spec.rb index 8b6bf54b642..ce19e491a7c 100644 --- a/spec/features/users/snippets_spec.rb +++ b/spec/features/users/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Snippets tab on a user profile', :js do +RSpec.describe 'Snippets tab on a user profile', :js do context 'when the user has snippets' do let(:user) { create(:user) } diff --git a/spec/features/users/terms_spec.rb b/spec/features/users/terms_spec.rb index ec2210faa80..5275845fe5b 100644 --- a/spec/features/users/terms_spec.rb +++ b/spec/features/users/terms_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Users > Terms' do +RSpec.describe 'Users > Terms' do include TermsHelper let!(:term) { create(:term, terms: 'By accepting, you promise to be nice!') } diff --git a/spec/features/users/user_browses_projects_on_user_page_spec.rb b/spec/features/users/user_browses_projects_on_user_page_spec.rb index 9a1ee7715d6..7d05b2ae27a 100644 --- a/spec/features/users/user_browses_projects_on_user_page_spec.rb +++ b/spec/features/users/user_browses_projects_on_user_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Users > User browses projects on user page', :js do +RSpec.describe 'Users > User browses projects on user page', :js do let!(:user) { create :user } let!(:private_project) do create :project, :private, name: 'private', namespace: user.namespace do |project| |