From 42afc4d656c20b2b9f909579097000c162eaf3a6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 3 Mar 2022 15:16:42 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo.yml | 5 -- .../analytics/cycle_analytics/stage_entity.rb | 2 +- app/services/projects/destroy_service.rb | 4 +- .../group_project_api_preload_plans.yml | 8 --- doc/user/project/service_desk.md | 14 ++++ lib/gitlab/ci/parsers/security/common.rb | 5 +- .../security/validators/schema_validator.rb | 26 ++++++-- .../email/handler/service_desk_handler.rb | 22 +++++-- .../import_export/project/import_export.yml | 1 + locale/gitlab.pot | 3 + spec/features/admin/admin_appearance_spec.rb | 2 +- .../admin/admin_broadcast_messages_spec.rb | 8 +-- spec/features/admin/admin_deploy_keys_spec.rb | 6 +- spec/features/admin/admin_groups_spec.rb | 2 +- spec/features/admin/admin_hook_logs_spec.rb | 2 +- spec/features/admin/admin_hooks_spec.rb | 10 +-- spec/features/admin/admin_mode/login_spec.rb | 14 ++-- spec/features/admin/admin_mode/logout_spec.rb | 4 +- spec/features/admin/admin_projects_spec.rb | 6 +- spec/features/admin/admin_settings_spec.rb | 2 +- spec/features/admin/users/user_spec.rb | 6 +- spec/features/admin/users/users_spec.rb | 2 +- spec/features/dashboard/group_spec.rb | 2 +- spec/features/dashboard/milestones_spec.rb | 8 +-- spec/features/dashboard/projects_spec.rb | 2 +- spec/features/dashboard/todos/todos_spec.rb | 2 +- spec/features/explore/topics_spec.rb | 4 +- .../features/file_uploads/user_avatar_spec.rb | 2 +- spec/features/groups/group_settings_spec.rb | 12 ++-- spec/features/groups/labels/create_spec.rb | 2 +- spec/features/groups/labels/edit_spec.rb | 2 +- .../groups/members/leave_group_spec.rb | 8 +-- spec/features/groups_spec.rb | 12 ++-- spec/features/invites_spec.rb | 30 ++++----- spec/features/issues/move_spec.rb | 2 +- ...r_creates_branch_and_merge_request_spec.rb | 4 +- .../issues/user_creates_issue_spec.rb | 4 +- .../user_sees_mini_pipeline_graph_spec.rb | 2 +- .../user_lists_merge_requests_spec.rb | 2 +- .../milestones/user_views_milestones_spec.rb | 4 +- spec/features/oauth_login_spec.rb | 16 ++--- spec/features/password_reset_spec.rb | 8 +-- spec/features/profiles/account_spec.rb | 8 +-- spec/features/profiles/chat_names_spec.rb | 4 +- spec/features/profiles/password_spec.rb | 12 ++-- ...er_visits_profile_preferences_page_spec.rb | 4 +- spec/features/projects/artifacts/file_spec.rb | 2 +- spec/features/projects/artifacts/raw_spec.rb | 2 +- .../artifacts/user_browses_artifacts_spec.rb | 2 +- ...project_owner_creates_license_file_spec.rb | 12 ++-- ...eate_license_file_in_empty_project_spec.rb | 4 +- .../projects/files/user_browses_files_spec.rb | 18 ++--- .../files/user_creates_directory_spec.rb | 6 +- .../projects/files/user_creates_files_spec.rb | 10 +-- .../projects/files/user_deletes_files_spec.rb | 4 +- .../projects/files/user_edits_files_spec.rb | 8 +-- .../files/user_replaces_files_spec.rb | 2 +- .../user_activates_issue_tracker_spec.rb | 6 +- .../integrations/user_activates_jira_spec.rb | 6 +- ...user_activates_slack_slash_command_spec.rb | 4 +- .../projects/jobs/user_browses_jobs_spec.rb | 2 +- spec/features/projects/jobs_spec.rb | 8 +-- .../members/member_leaves_project_spec.rb | 4 +- spec/features/projects/new_project_spec.rb | 4 +- .../projects/pipelines/pipeline_spec.rb | 4 +- .../projects/pipelines/pipelines_spec.rb | 2 +- .../user_interacts_with_deploy_keys_spec.rb | 4 +- .../settings/user_renames_a_project_spec.rb | 6 +- .../settings/user_transfers_a_project_spec.rb | 6 +- .../settings/webhooks_settings_spec.rb | 4 +- spec/features/projects/show/redirects_spec.rb | 8 +-- .../show/user_interacts_with_stars_spec.rb | 2 +- .../show/user_sees_git_instructions_spec.rb | 2 +- .../projects/tags/user_views_tags_spec.rb | 2 +- .../projects/user_creates_project_spec.rb | 6 +- .../tags/developer_creates_tag_spec.rb | 8 +-- .../tags/developer_deletes_tag_spec.rb | 6 +- .../tags/developer_updates_tag_spec.rb | 8 +-- .../tags/developer_views_tags_spec.rb | 20 +++--- spec/features/unsubscribe_links_spec.rb | 8 +-- spec/features/users/active_sessions_spec.rb | 6 +- spec/features/users/login_spec.rb | 66 +++++++++---------- spec/features/users/logout_spec.rb | 4 +- spec/features/users/signup_spec.rb | 14 ++-- spec/features/users/terms_spec.rb | 8 +-- .../emails/service_desk_reply_to_and_from.eml | 28 ++++++++ .../gitlab/ci/parsers/security/common_spec.rb | 6 +- .../validators/schema_validator_spec.rb | 19 ++++-- .../handler/service_desk_handler_spec.rb | 14 ++++ .../project/relation_factory_spec.rb | 16 +++++ .../services/projects/destroy_service_spec.rb | 7 +- spec/support/helpers/terms_helper.rb | 2 +- ...ash_command_integration_shared_examples.rb | 4 +- .../project_upload_files_shared_examples.rb | 4 +- .../user_creates_wiki_page_shared_examples.rb | 14 ++-- .../user_updates_wiki_page_shared_examples.rb | 20 +++--- .../user_views_wiki_page_shared_examples.rb | 12 ++-- 97 files changed, 429 insertions(+), 325 deletions(-) delete mode 100644 config/feature_flags/development/group_project_api_preload_plans.yml create mode 100644 spec/fixtures/emails/service_desk_reply_to_and_from.eml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a3835072aca..d7632c36103 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,11 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 314 -# Cop supports --auto-correct. -Capybara/CurrentPathExpectation: - Enabled: false - # Offense count: 221 Capybara/VisibilityMatcher: Enabled: false diff --git a/app/serializers/analytics/cycle_analytics/stage_entity.rb b/app/serializers/analytics/cycle_analytics/stage_entity.rb index ac19998e90e..c1d415dfb40 100644 --- a/app/serializers/analytics/cycle_analytics/stage_entity.rb +++ b/app/serializers/analytics/cycle_analytics/stage_entity.rb @@ -57,7 +57,7 @@ module Analytics def html_description(event) options = {} if event.label_based? - label = event.label.present + label = event.label.present(issuable_subject: event.label.subject) options[:label_html] = render_label(label, link: '', small: true, tooltip: true) end diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index c736070dd8e..adbc26420c7 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -72,7 +72,9 @@ module Projects end def remove_snippets - response = ::Snippets::BulkDestroyService.new(current_user, project.snippets).execute + # We're setting the hard_delete param because we dont need to perform the access checks within the service since + # the user has enough access rights to remove the project and its resources. + response = ::Snippets::BulkDestroyService.new(current_user, project.snippets).execute(hard_delete: true) if response.error? log_error("Snippet deletion failed on #{project.full_path} with the following message: #{response.message}") diff --git a/config/feature_flags/development/group_project_api_preload_plans.yml b/config/feature_flags/development/group_project_api_preload_plans.yml deleted file mode 100644 index 3854bed461a..00000000000 --- a/config/feature_flags/development/group_project_api_preload_plans.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: group_project_api_preload_plans -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77538 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/350176 -milestone: '14.7' -type: development -group: group::authentication and authorization -default_enabled: false diff --git a/doc/user/project/service_desk.md b/doc/user/project/service_desk.md index b7fe5a2be29..90732ba4fe2 100644 --- a/doc/user/project/service_desk.md +++ b/doc/user/project/service_desk.md @@ -330,6 +330,20 @@ Note that: - The project's visibility (private, internal, public) does not affect Service Desk. - The path to the project, including its group or namespace, is shown in emails. +#### Issues created on someone's behalf + +To allow third party applications and ticketing systems to interface with Service Desk, +when the email contains the `Reply-To` email header, this email address is used as the address of the +issue author. + +Because the `Reply-To` header can be set to arbitrary values, do not blindly trust that an issue +created on behalf of `someone@example.com` was indeed created by the real owner of such email address. + +For example, an email with headers `To: support@example.com` and `Reply-To:someone@example.com` +creates an issue with the following note: + +> Created (…) by `support@example.com` (reply to: `someone@example.com`) (…) + #### Privacy considerations Service Desk issues are confidential, but the project owner can diff --git a/lib/gitlab/ci/parsers/security/common.rb b/lib/gitlab/ci/parsers/security/common.rb index ff8641c014d..52b6c20a3ab 100644 --- a/lib/gitlab/ci/parsers/security/common.rb +++ b/lib/gitlab/ci/parsers/security/common.rb @@ -19,6 +19,8 @@ module Gitlab end def parse! + set_report_version + return report_data unless valid? raise SecurityReportParserError, "Invalid report format" unless report_data.is_a?(Hash) @@ -26,7 +28,6 @@ module Gitlab create_scanner create_scan create_analyzer - set_report_version create_findings @@ -66,7 +67,7 @@ module Gitlab end def schema_validator - @schema_validator ||= ::Gitlab::Ci::Parsers::Security::Validators::SchemaValidator.new(report.type, report_data) + @schema_validator ||= ::Gitlab::Ci::Parsers::Security::Validators::SchemaValidator.new(report.type, report_data, report.version) end def report_data diff --git a/lib/gitlab/ci/parsers/security/validators/schema_validator.rb b/lib/gitlab/ci/parsers/security/validators/schema_validator.rb index 1dce0cb18a8..0ab1a128052 100644 --- a/lib/gitlab/ci/parsers/security/validators/schema_validator.rb +++ b/lib/gitlab/ci/parsers/security/validators/schema_validator.rb @@ -46,15 +46,16 @@ module Gitlab File.join(__dir__, 'schemas') end - def initialize(report_type) + def initialize(report_type, report_version) @report_type = report_type.to_sym + @report_version = report_version.to_s end delegate :validate, to: :schemer private - attr_reader :report_type + attr_reader :report_type, :report_version def schemer JSONSchemer.schema(pathname) @@ -65,7 +66,19 @@ module Gitlab end def schema_path - File.join(root_path, file_name) + # We can't exactly error out here pre-15.0. + # If the report itself doesn't specify the schema version, + # it will be considered invalid post-15.0 but for now we will + # validate against earliest supported version. + # https://gitlab.com/gitlab-org/gitlab/-/issues/335789#note_801479803 + # describes the indended behavior in detail + # TODO: After 15.0 - pass report_type and report_data here and + # error out if no version. + report_declared_version = File.join(root_path, report_version, file_name) + return report_declared_version if File.file?(report_declared_version) + + earliest_supported_version = SUPPORTED_VERSIONS[report_type].min + File.join(root_path, earliest_supported_version, file_name) end def file_name @@ -73,9 +86,10 @@ module Gitlab end end - def initialize(report_type, report_data) + def initialize(report_type, report_data, report_version = nil) @report_type = report_type @report_data = report_data + @report_version = report_version end def valid? @@ -88,10 +102,10 @@ module Gitlab private - attr_reader :report_type, :report_data + attr_reader :report_type, :report_data, :report_version def schema - Schema.new(report_type) + Schema.new(report_type, report_version) end end end diff --git a/lib/gitlab/email/handler/service_desk_handler.rb b/lib/gitlab/email/handler/service_desk_handler.rb index 71b1d4ed8f9..bb57494c729 100644 --- a/lib/gitlab/email/handler/service_desk_handler.rb +++ b/lib/gitlab/email/handler/service_desk_handler.rb @@ -34,7 +34,7 @@ module Gitlab create_issue_or_note - if from_address + if issue_creator_address add_email_participant send_thank_you_email unless reply_email? end @@ -98,7 +98,7 @@ module Gitlab title: mail.subject, description: message_including_template, confidential: true, - external_author: from_address + external_author: external_author }, spam_params: nil ).execute @@ -176,8 +176,22 @@ module Gitlab ).execute end + def issue_creator_address + reply_to_address || from_address + end + def from_address - (mail.reply_to || []).first || mail.from.first || mail.sender + mail.from.first || mail.sender + end + + def reply_to_address + (mail.reply_to || []).first + end + + def external_author + return issue_creator_address unless reply_to_address && from_address + + _("%{from_address} (reply to: %{reply_to_address})") % { from_address: from_address, reply_to_address: reply_to_address } end def can_handle_legacy_format? @@ -191,7 +205,7 @@ module Gitlab def add_email_participant return if reply_email? && !Feature.enabled?(:issue_email_participants, @issue.project) - @issue.issue_email_participants.create(email: from_address) + @issue.issue_email_participants.create(email: issue_creator_address) end end end diff --git a/lib/gitlab/import_export/project/import_export.yml b/lib/gitlab/import_export/project/import_export.yml index 059f6bd42e3..fc05cc1a79c 100644 --- a/lib/gitlab/import_export/project/import_export.yml +++ b/lib/gitlab/import_export/project/import_export.yml @@ -370,6 +370,7 @@ included_attributes: - :name - :email events: + - :project_id - :target_type - :action - :author_id diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 6566c0a7aae..337cf832ee7 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -663,6 +663,9 @@ msgstr "" msgid "%{firstMilestoneName} + %{numberOfOtherMilestones} more" msgstr "" +msgid "%{from_address} (reply to: %{reply_to_address})" +msgstr "" + msgid "%{gitlab_experience_text}. Don't worry, this information isn't shared outside of your self-managed GitLab instance." msgstr "" diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index 0785c736cfb..8bf8ef56353 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin Appearance' do fill_in 'appearance_profile_image_guidelines', with: 'Custom profile image guidelines' click_button 'Update appearance settings' - expect(current_path).to eq admin_application_settings_appearances_path + expect(page).to have_current_path admin_application_settings_appearances_path, ignore_query: true expect(page).to have_content 'Appearance' expect(page).to have_field('appearance_title', with: 'MyCompany') diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index 476dd4469bc..39ee6c1ed5c 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Admin Broadcast Messages' do select Date.today.next_year.year, from: 'broadcast_message_ends_at_1i' click_button 'Add broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' expect(page).to have_content '*/user_onboarded' expect(page).to have_selector 'strong', text: '4:00 CST to 5:00 CST' @@ -37,7 +37,7 @@ RSpec.describe 'Admin Broadcast Messages' do select Date.today.next_year.year, from: 'broadcast_message_ends_at_1i' click_button 'Add broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' expect(page).to have_content '*/user_onboarded' expect(page).to have_content 'Notification' @@ -49,14 +49,14 @@ RSpec.describe 'Admin Broadcast Messages' do fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' click_button 'Update broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update RIGHT NOW' end it 'remove an existing broadcast message' do click_link 'Remove' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).not_to have_content 'Migration to new server' end diff --git a/spec/features/admin/admin_deploy_keys_spec.rb b/spec/features/admin/admin_deploy_keys_spec.rb index 88b8fcd8d5e..56b8c7fce14 100644 --- a/spec/features/admin/admin_deploy_keys_spec.rb +++ b/spec/features/admin/admin_deploy_keys_spec.rb @@ -47,7 +47,7 @@ RSpec.describe 'admin deploy keys', :js do fill_in 'deploy_key_key', with: new_ssh_key click_button 'Create' - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).to have_content('laptop') @@ -67,7 +67,7 @@ RSpec.describe 'admin deploy keys', :js do fill_in 'deploy_key_title', with: 'new-title' click_button 'Save changes' - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).to have_content('new-title') @@ -87,7 +87,7 @@ RSpec.describe 'admin deploy keys', :js do end end - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).not_to have_content(deploy_key.title) end diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index a0a41061d64..3b3289a8487 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -58,7 +58,7 @@ RSpec.describe 'Admin Groups' do fill_in 'group_admin_note_attributes_note', with: group_admin_note click_button "Create group" - expect(current_path).to eq admin_group_path(Group.find_by(path: path_component)) + expect(page).to have_current_path admin_group_path(Group.find_by(path: path_component)), ignore_query: true content = page.find('#content-body') h3_texts = content.all('h3').collect(&:text).join("\n") expect(h3_texts).to match group_name diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 837cab49bd4..fd51fd71fea 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -39,6 +39,6 @@ RSpec.describe 'Admin::HookLogs' do click_link 'View details' click_link 'Resend Request' - expect(current_path).to eq(edit_admin_hook_path(system_hook)) + expect(page).to have_current_path(edit_admin_hook_path(system_hook), ignore_query: true) end end diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 32e4d18227e..388ab02d8e8 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Hooks' do click_on 'System Hooks', match: :first end - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) end it 'has hooks list' do @@ -49,7 +49,7 @@ RSpec.describe 'Admin::Hooks' do expect { click_button 'Add system hook' }.to change(SystemHook, :count).by(1) expect(page).to have_content 'SSL Verification: enabled' - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(url) end end @@ -70,7 +70,7 @@ RSpec.describe 'Admin::Hooks' do click_button 'Save changes' expect(page).to have_content 'SSL Verification: enabled' - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(new_url) end end @@ -111,7 +111,7 @@ RSpec.describe 'Admin::Hooks' do click_link 'Push events' end - it { expect(current_path).to eq(admin_hooks_path) } + it { expect(page).to have_current_path(admin_hooks_path, ignore_query: true) } end context 'Merge request hook' do @@ -126,7 +126,7 @@ RSpec.describe 'Admin::Hooks' do check 'Merge request events' expect { click_button 'Add system hook' }.to change(SystemHook, :count).by(1) - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(url) end end diff --git a/spec/features/admin/admin_mode/login_spec.rb b/spec/features/admin/admin_mode/login_spec.rb index c8ee6c14499..659f66a67d2 100644 --- a/spec/features/admin/admin_mode/login_spec.rb +++ b/spec/features/admin/admin_mode/login_spec.rb @@ -30,7 +30,7 @@ RSpec.describe 'Admin Mode Login' do enter_code(repeated_otp) - expect(current_path).to eq admin_session_path + expect(page).to have_current_path admin_session_path, ignore_query: true expect(page).to have_content('Invalid two-factor code') end @@ -51,7 +51,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -74,7 +74,7 @@ RSpec.describe 'Admin Mode Login' do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -93,7 +93,7 @@ RSpec.describe 'Admin Mode Login' do it 'allows login' do enter_code(codes.sample) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end @@ -146,7 +146,7 @@ RSpec.describe 'Admin Mode Login' do enable_admin_mode_using_saml! expect(page).not_to have_content('Two-Factor Authentication') - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -166,7 +166,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -218,7 +218,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb index f2f6e26fbee..3ca66ef0d6a 100644 --- a/spec/features/admin/admin_mode/logout_spec.rb +++ b/spec/features/admin/admin_mode/logout_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'Admin Mode Logout', :js do it 'disable removes admin mode and redirects to root page' do gitlab_disable_admin_mode - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true open_top_nav @@ -43,7 +43,7 @@ RSpec.describe 'Admin Mode Logout', :js do it 'disable removes admin mode and redirects to root page' do gitlab_disable_admin_mode - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true open_top_nav diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index 8938bab60d7..d401a063cf5 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -26,7 +26,7 @@ RSpec.describe "Admin::Projects" do end it "is ok" do - expect(current_path).to eq(admin_projects_path) + expect(page).to have_current_path(admin_projects_path, ignore_query: true) end it 'renders projects list without archived project' do @@ -63,7 +63,7 @@ RSpec.describe "Admin::Projects" do end it "has project info" do - expect(current_path).to eq admin_project_path(project) + expect(page).to have_current_path admin_project_path(project), ignore_query: true expect(page).to have_content(project.path) expect(page).to have_content(project.name) expect(page).to have_content(project.full_name) @@ -150,7 +150,7 @@ RSpec.describe "Admin::Projects" do click_button('Leave') end - expect(current_path).to match dashboard_projects_path + expect(page).to have_current_path(dashboard_projects_path, ignore_query: true, url: false) end end diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index ca452264c02..d4ce1c37585 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -838,7 +838,7 @@ RSpec.describe 'Admin updates settings' do end it 'loads admin settings page without redirect for reauthentication' do - expect(current_path).to eq general_admin_application_settings_path + expect(page).to have_current_path general_admin_application_settings_path, ignore_query: true end end diff --git a/spec/features/admin/users/user_spec.rb b/spec/features/admin/users/user_spec.rb index a897f5e24b6..7e8dee9cc0b 100644 --- a/spec/features/admin/users/user_spec.rb +++ b/spec/features/admin/users/user_spec.rb @@ -226,7 +226,7 @@ RSpec.describe 'Admin::Users::User' do it 'does not redirect to password change page' do subject - expect(current_path).to eq('/') + expect(page).to have_current_path('/') end end end @@ -250,7 +250,7 @@ RSpec.describe 'Admin::Users::User' do it 'is redirected back to the impersonated users page in the admin after stopping' do subject - expect(current_path).to eq("/admin/users/#{another_user.username}") + expect(page).to have_current_path("/admin/users/#{another_user.username}", ignore_query: true) end context 'a user with an expired password' do @@ -261,7 +261,7 @@ RSpec.describe 'Admin::Users::User' do it 'is redirected back to the impersonated users page in the admin after stopping' do subject - expect(current_path).to eq("/admin/users/#{another_user.username}") + expect(page).to have_current_path("/admin/users/#{another_user.username}", ignore_query: true) end end end diff --git a/spec/features/admin/users/users_spec.rb b/spec/features/admin/users/users_spec.rb index f043765b3ad..3191a91a69f 100644 --- a/spec/features/admin/users/users_spec.rb +++ b/spec/features/admin/users/users_spec.rb @@ -21,7 +21,7 @@ RSpec.describe 'Admin::Users' do end it "is ok" do - expect(current_path).to eq(admin_users_path) + expect(page).to have_current_path(admin_users_path, ignore_query: true) end it "has users list" do diff --git a/spec/features/dashboard/group_spec.rb b/spec/features/dashboard/group_spec.rb index 02cbdc7c777..f1283d29f4c 100644 --- a/spec/features/dashboard/group_spec.rb +++ b/spec/features/dashboard/group_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Dashboard Group' do fill_in 'group_name', with: new_name click_button 'Create group' - expect(current_path).to eq group_path(Group.find_by(name: new_name)) + expect(page).to have_current_path group_path(Group.find_by(name: new_name)), ignore_query: true expect(page).to have_content(new_name) end end diff --git a/spec/features/dashboard/milestones_spec.rb b/spec/features/dashboard/milestones_spec.rb index 9758454ab61..3f89955b12b 100644 --- a/spec/features/dashboard/milestones_spec.rb +++ b/spec/features/dashboard/milestones_spec.rb @@ -9,7 +9,7 @@ RSpec.describe 'Dashboard > Milestones' do end it 'is redirected to sign-in page' do - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end end @@ -27,7 +27,7 @@ RSpec.describe 'Dashboard > Milestones' do end it 'sees milestones' do - expect(current_path).to eq dashboard_milestones_path + expect(page).to have_current_path dashboard_milestones_path, ignore_query: true expect(page).to have_content(milestone.title) expect(page).to have_content(group.name) expect(first('.milestone')).to have_content('Merge requests') @@ -43,7 +43,7 @@ RSpec.describe 'Dashboard > Milestones' do find('.js-new-project-item-link').click - expect(current_path).to eq(new_group_milestone_path(group)) + expect(page).to have_current_path(new_group_milestone_path(group), ignore_query: true) end end end @@ -61,7 +61,7 @@ RSpec.describe 'Dashboard > Milestones' do end it 'does not see milestones' do - expect(current_path).to eq dashboard_milestones_path + expect(page).to have_current_path dashboard_milestones_path, ignore_query: true expect(page).to have_content(milestone.title) expect(first('.milestone')).to have_no_content('Merge Requests') end diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 97712b405ad..847d0faf60d 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -236,7 +236,7 @@ RSpec.describe 'Dashboard Projects' do end expect(page).to have_selector('.merge-request-form') - expect(current_path).to eq project_new_merge_request_path(project) + expect(page).to have_current_path project_new_merge_request_path(project), ignore_query: true expect(find('#merge_request_target_project_id', visible: false).value).to eq project.id.to_s expect(page).to have_content "From feature into master" end diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb index ef3032f30c9..68d979bb1cf 100644 --- a/spec/features/dashboard/todos/todos_spec.rb +++ b/spec/features/dashboard/todos/todos_spec.rb @@ -441,7 +441,7 @@ RSpec.describe 'Dashboard Todos' do target.project, target.issue, target.filename ) - expect(current_path).to eq(expectation) + expect(page).to have_current_path(expectation, ignore_query: true) end end end diff --git a/spec/features/explore/topics_spec.rb b/spec/features/explore/topics_spec.rb index 9d2e76bc3a1..d6f3d6a123d 100644 --- a/spec/features/explore/topics_spec.rb +++ b/spec/features/explore/topics_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'Explore Topics' do it 'renders empty message', :aggregate_failures do visit topics_explore_projects_path - expect(current_path).to eq topics_explore_projects_path + expect(page).to have_current_path topics_explore_projects_path, ignore_query: true expect(page).to have_content('There are no topics to show.') end end @@ -18,7 +18,7 @@ RSpec.describe 'Explore Topics' do it 'renders topic list' do visit topics_explore_projects_path - expect(current_path).to eq topics_explore_projects_path + expect(page).to have_current_path topics_explore_projects_path, ignore_query: true expect(page).to have_content('topic1') end end diff --git a/spec/features/file_uploads/user_avatar_spec.rb b/spec/features/file_uploads/user_avatar_spec.rb index c30e3452201..34cfb4a4128 100644 --- a/spec/features/file_uploads/user_avatar_spec.rb +++ b/spec/features/file_uploads/user_avatar_spec.rb @@ -26,7 +26,7 @@ RSpec.describe 'Upload a user avatar', :js do expect(page).to have_content 'Profile was successfully updated' expect(user.reload.avatar.file).to be_present expect(user.avatar).to be_instance_of AvatarUploader - expect(current_path).to eq(profile_path) + expect(page).to have_current_path(profile_path, ignore_query: true) end end diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 151d0d0072c..50982cb1452 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit new_group_full_path - expect(current_path).to eq(new_group_full_path) + expect(page).to have_current_path(new_group_full_path, ignore_query: true) expect(find('h1.home-panel-title')).to have_content(group.name) end @@ -28,7 +28,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit old_group_full_path - expect(current_path).to eq(new_group_full_path) + expect(page).to have_current_path(new_group_full_path, ignore_query: true) expect(find('h1.home-panel-title')).to have_content(group.name) end @@ -41,7 +41,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit new_subgroup_full_path - expect(current_path).to eq(new_subgroup_full_path) + expect(page).to have_current_path(new_subgroup_full_path, ignore_query: true) expect(find('h1.home-panel-title')).to have_content(subgroup.name) end @@ -49,7 +49,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit old_subgroup_full_path - expect(current_path).to eq(new_subgroup_full_path) + expect(page).to have_current_path(new_subgroup_full_path, ignore_query: true) expect(find('h1.home-panel-title')).to have_content(subgroup.name) end end @@ -71,7 +71,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit new_project_full_path - expect(current_path).to eq(new_project_full_path) + expect(page).to have_current_path(new_project_full_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.path) end @@ -79,7 +79,7 @@ RSpec.describe 'Edit group settings' do update_path(new_group_path) visit old_project_full_path - expect(current_path).to eq(new_project_full_path) + expect(page).to have_current_path(new_project_full_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.path) end end diff --git a/spec/features/groups/labels/create_spec.rb b/spec/features/groups/labels/create_spec.rb index 9c1a3672ebd..19433e612ff 100644 --- a/spec/features/groups/labels/create_spec.rb +++ b/spec/features/groups/labels/create_spec.rb @@ -18,6 +18,6 @@ RSpec.describe 'Create a group label' do click_button 'Create label' expect(page).to have_content 'test-label' - expect(current_path).to eq(group_labels_path(group)) + expect(page).to have_current_path(group_labels_path(group), ignore_query: true) end end diff --git a/spec/features/groups/labels/edit_spec.rb b/spec/features/groups/labels/edit_spec.rb index 8e6560af352..cf1729af97d 100644 --- a/spec/features/groups/labels/edit_spec.rb +++ b/spec/features/groups/labels/edit_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'Edit group label' do fill_in 'label_title', with: 'new label name' click_button 'Save changes' - expect(current_path).to eq(root_path) + expect(page).to have_current_path(root_path, ignore_query: true) expect(label.reload.title).to eq('new label name') end diff --git a/spec/features/groups/members/leave_group_spec.rb b/spec/features/groups/members/leave_group_spec.rb index 9612c6625f6..50d5db46cee 100644 --- a/spec/features/groups/members/leave_group_spec.rb +++ b/spec/features/groups/members/leave_group_spec.rb @@ -21,7 +21,7 @@ RSpec.describe 'Groups > Members > Leave group' do visit group_path(group) click_link 'Leave group' - expect(current_path).to eq(dashboard_groups_path) + expect(page).to have_current_path(dashboard_groups_path, ignore_query: true) expect(page).to have_content left_group_message(group) expect(group.users).not_to include(user) end @@ -35,7 +35,7 @@ RSpec.describe 'Groups > Members > Leave group' do page.accept_confirm wait_for_all_requests - expect(current_path).to eq(dashboard_groups_path) + expect(page).to have_current_path(dashboard_groups_path, ignore_query: true) expect(group.users).not_to include(user) end @@ -45,7 +45,7 @@ RSpec.describe 'Groups > Members > Leave group' do visit group_path(group) click_link 'Leave group' - expect(current_path).to eq(dashboard_groups_path) + expect(page).to have_current_path(dashboard_groups_path, ignore_query: true) expect(page).to have_content left_group_message(group) expect(group.users).not_to include(user) end @@ -57,7 +57,7 @@ RSpec.describe 'Groups > Members > Leave group' do visit group_path(group) click_link 'Leave group' - expect(current_path).to eq(dashboard_groups_path) + expect(page).to have_current_path(dashboard_groups_path, ignore_query: true) expect(page).to have_content left_group_message(group) expect(group.users).not_to include(user) end diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 925bbc47cf6..1fb5567b928 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -32,7 +32,7 @@ RSpec.describe 'Group' do group = Group.find_by(name: 'test-group') expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC) - expect(current_path).to eq(group_path(group)) + expect(page).to have_current_path(group_path(group), ignore_query: true) expect(page).to have_selector '.visibility-icon [data-testid="earth-icon"]' end end @@ -51,7 +51,7 @@ RSpec.describe 'Group' do fill_in 'Group URL', with: 'space group' click_button 'Create group' - expect(current_path).to eq(new_group_path) + expect(page).to have_current_path(new_group_path, ignore_query: true) expect(page).to have_text('Choose a group path that does not start with a dash or end with a period. It can also contain alphanumeric characters and underscores.') end end @@ -62,7 +62,7 @@ RSpec.describe 'Group' do fill_in 'Group URL', with: 'atom_group.atom' click_button 'Create group' - expect(current_path).to eq(groups_path) + expect(page).to have_current_path(groups_path, ignore_query: true) expect(page).to have_namespace_error_message end end @@ -73,7 +73,7 @@ RSpec.describe 'Group' do fill_in 'Group URL', with: 'git_group.git' click_button 'Create group' - expect(current_path).to eq(groups_path) + expect(page).to have_current_path(groups_path, ignore_query: true) expect(page).to have_namespace_error_message end end @@ -211,7 +211,7 @@ RSpec.describe 'Group' do fill_in 'Group name', with: 'bar' click_button 'Create group' - expect(current_path).to eq(group_path('foo/bar')) + expect(page).to have_current_path(group_path('foo/bar'), ignore_query: true) expect(page).to have_selector 'h1', text: 'bar' end end @@ -237,7 +237,7 @@ RSpec.describe 'Group' do fill_in 'Group name', with: 'bar' click_button 'Create group' - expect(current_path).to eq(group_path('foo/bar')) + expect(page).to have_current_path(group_path('foo/bar'), ignore_query: true) expect(page).to have_selector 'h1', text: 'bar' end end diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index 9cb9416e7a0..965e97baadd 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -57,7 +57,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end it 'renders sign up page with sign up notice' do - expect(current_path).to eq(new_user_registration_path) + expect(page).to have_current_path(new_user_registration_path, ignore_query: true) expect(page).to have_content('To accept this invitation, create an account or sign in') end @@ -85,7 +85,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_in_form(user) - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end end @@ -98,7 +98,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end it 'shows message user already a member' do - expect(current_path).to eq(invite_path(group_invite.raw_invite_token)) + expect(page).to have_current_path(invite_path(group_invite.raw_invite_token), ignore_query: true) expect(page).to have_link(user.name, href: user_path(user)) expect(page).to have_content('You are already a member of this group.') end @@ -127,7 +127,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end it 'declines application and redirects to dashboard' do - expect(current_path).to eq(dashboard_projects_path) + expect(page).to have_current_path(dashboard_projects_path, ignore_query: true) expect(page).to have_content('You have declined the invitation to join group Owned.') expect { group_invite.reload }.to raise_error ActiveRecord::RecordNotFound end @@ -139,7 +139,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do end it 'declines application and redirects to sign in page' do - expect(current_path).to eq(decline_invite_path(group_invite.raw_invite_token)) + expect(page).to have_current_path(decline_invite_path(group_invite.raw_invite_token), ignore_query: true) expect(page).not_to have_content('You have declined the invitation to join') expect(page).to have_content('You successfully declined the invitation') expect { group_invite.reload }.to raise_error ActiveRecord::RecordNotFound @@ -174,7 +174,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do it 'does not sign the user in' do fill_in_sign_up_form(new_user) - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) expect(page).to have_content('You have signed up successfully. However, we could not sign you in because your account is awaiting approval from your GitLab administrator') end end @@ -186,7 +186,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_up_form(new_user) fill_in_welcome_form - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) expect(page).to have_content('You have been granted Owner access to group Owned.') end @@ -197,7 +197,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_up_form(new_user) fill_in_welcome_form - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end end end @@ -209,7 +209,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do it 'fails sign up and redirects back to sign up', :aggregate_failures do expect { fill_in_sign_up_form(new_user) }.not_to change { User.count } expect(page).to have_content('prohibited this user from being saved') - expect(current_path).to eq(user_registration_path) + expect(page).to have_current_path(user_registration_path, ignore_query: true) end end @@ -230,7 +230,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_up_form(new_user) fill_in_welcome_form - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end context 'the user sign-up using a different email address' do @@ -248,7 +248,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_in_form(new_user) fill_in_welcome_form - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end end @@ -262,7 +262,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do fill_in_sign_up_form(new_user) fill_in_welcome_form - expect(current_path).to eq(activity_group_path(group)) + expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end end end @@ -273,11 +273,11 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do it 'lands on sign up page and then registers' do visit invite_path(group_invite.raw_invite_token) - expect(current_path).to eq(new_user_registration_path) + expect(page).to have_current_path(new_user_registration_path, ignore_query: true) fill_in_sign_up_form(new_user, 'Register') - expect(current_path).to eq(users_sign_up_welcome_path) + expect(page).to have_current_path(users_sign_up_welcome_path, ignore_query: true) end end @@ -285,7 +285,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do it 'declines application and shows a decline page' do visit decline_invite_path(group_invite.raw_invite_token) - expect(current_path).to eq(decline_invite_path(group_invite.raw_invite_token)) + expect(page).to have_current_path(decline_invite_path(group_invite.raw_invite_token), ignore_query: true) expect(page).to have_content('You successfully declined the invitation') expect { group_invite.reload }.to raise_error ActiveRecord::RecordNotFound end diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index ee2fbf0865e..054b7b3855b 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -50,7 +50,7 @@ RSpec.describe 'issue move to another project' do expect(page).to have_content("Text with #{cross_reference}#{mr.to_reference}") expect(page).to have_content("moved from #{cross_reference}#{issue.to_reference}") expect(page).to have_content(issue.title) - expect(page.current_path).to include project_path(new_project) + expect(page).to have_current_path(%r(#{project_path(new_project)})) end it 'searching project dropdown', :js do 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 167521134b1..fa6725bc294 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 @@ -83,7 +83,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do wait_for_requests expect(page).to have_selector('.dropdown-toggle-text ', text: '1-cherry-coloured-funk') - expect(current_path).to eq project_tree_path(project, '1-cherry-coloured-funk') + expect(page).to have_current_path project_tree_path(project, '1-cherry-coloured-funk'), ignore_query: true end end @@ -106,7 +106,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do wait_for_requests expect(page).to have_selector('.dropdown-toggle-text ', text: branch_name) - expect(current_path).to eq project_tree_path(project, branch_name) + expect(page).to have_current_path project_tree_path(project, branch_name), ignore_query: true end end end diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 37e324e6ded..446f13dc4d0 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -22,11 +22,11 @@ RSpec.describe "User creates issue" do click_link "New issue" end - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true gitlab_sign_in(create(:user)) - expect(current_path).to eq new_project_issue_path(project) + expect(page).to have_current_path new_project_issue_path(project), ignore_query: true end end 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 e5592ae9535..23b03e33f5d 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 @@ -137,7 +137,7 @@ RSpec.describe 'Merge request < User sees mini pipeline graph', :js do build_item.click find('.build-page') - expect(current_path).to eql(project_job_path(project, build)) + expect(page).to have_current_path(project_job_path(project, build), ignore_query: true) end it 'shows tooltip when hovered' do 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 f96717970bf..8c1d9dd38b0 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -77,7 +77,7 @@ RSpec.describe 'Merge requests > User lists merge requests' do it 'filters on no assignee' do visit_merge_requests(project, assignee_id: IssuableFinder::Params::FILTER_NONE) - expect(current_path).to eq(project_merge_requests_path(project)) + expect(page).to have_current_path(project_merge_requests_path(project), ignore_query: true) expect(page).to have_content 'merge-test' expect(page).to have_content 'feature' expect(page).not_to have_content 'fix' diff --git a/spec/features/milestones/user_views_milestones_spec.rb b/spec/features/milestones/user_views_milestones_spec.rb index 58439df92ba..752cc63486f 100644 --- a/spec/features/milestones/user_views_milestones_spec.rb +++ b/spec/features/milestones/user_views_milestones_spec.rb @@ -28,7 +28,7 @@ RSpec.describe "User views milestones" do it "opens milestone" do click_link(milestone.title) - expect(current_path).to eq(project_milestone_path(project, milestone)) + expect(page).to have_current_path(project_milestone_path(project, milestone), ignore_query: true) expect(page).to have_content(milestone.title) .and have_selector("#tab-issues li.issuable-row", count: 2) .and have_content(issue.title) @@ -85,7 +85,7 @@ RSpec.describe "User views milestones with no MR" do it "opens milestone" do click_link(milestone.title) - expect(current_path).to eq(project_milestone_path(project, milestone)) + expect(page).to have_current_path(project_milestone_path(project, milestone), ignore_query: true) expect(page).to have_content(milestone.title) .and have_selector("#tab-issues") .and have_no_selector("#tab-merge-requests") diff --git a/spec/features/oauth_login_spec.rb b/spec/features/oauth_login_spec.rb index 0ea14bc00a5..93674057fed 100644 --- a/spec/features/oauth_login_spec.rb +++ b/spec/features/oauth_login_spec.rb @@ -45,7 +45,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do it 'logs the user in' do login_with_provider(provider, additional_info: additional_info) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end end @@ -55,19 +55,19 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do it 'logs the user in' do login_with_provider(provider, additional_info: additional_info, enter_two_factor: true) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end it 'when bypass-two-factor is enabled' do allow(Gitlab.config.omniauth).to receive_messages(allow_bypass_two_factor: true) login_via(provider.to_s, user, uid, remember_me: false, additional_info: additional_info) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end it 'when bypass-two-factor is disabled' do allow(Gitlab.config.omniauth).to receive_messages(allow_bypass_two_factor: false) login_with_provider(provider, enter_two_factor: true, additional_info: additional_info) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end end @@ -81,7 +81,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do clear_browser_session visit(root_path) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end end @@ -94,7 +94,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do clear_browser_session visit(root_path) - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true end end end @@ -107,7 +107,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do clear_browser_session visit(root_path) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end end @@ -120,7 +120,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do clear_browser_session visit(root_path) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end end end diff --git a/spec/features/password_reset_spec.rb b/spec/features/password_reset_spec.rb index 322ccc6a0c0..a4e167a3e75 100644 --- a/spec/features/password_reset_spec.rb +++ b/spec/features/password_reset_spec.rb @@ -9,7 +9,7 @@ RSpec.describe 'Password reset' do forgot_password(user) expect(page).to have_content(I18n.t('devise.passwords.send_paranoid_instructions')) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true expect(user.recently_sent_password_reset?).to be_truthy end @@ -20,7 +20,7 @@ RSpec.describe 'Password reset' do expect { forgot_password(user) }.to change { user.reset_password_sent_at } expect(page).to have_content(I18n.t('devise.passwords.send_paranoid_instructions')) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end it 'throttles multiple resets in a short timespan' do @@ -31,7 +31,7 @@ RSpec.describe 'Password reset' do expect { forgot_password(user) }.not_to change { user.reset_password_sent_at } expect(page).to have_content(I18n.t('devise.passwords.send_paranoid_instructions')) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end end @@ -50,7 +50,7 @@ RSpec.describe 'Password reset' do click_button 'Change your password' expect(page).to have_content(I18n.t('devise.passwords.updated_not_active')) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end end diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 2e8d9ef80cd..6a4a1fca008 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -50,14 +50,14 @@ RSpec.describe 'Profile > Account', :js do it 'the user is accessible via the new path' do update_username(new_username) visit new_user_path - expect(current_path).to eq(new_user_path) + expect(page).to have_current_path(new_user_path, ignore_query: true) expect(find('.user-info')).to have_content(new_username) end it 'the old user path redirects to the new path' do update_username(new_username) visit old_user_path - expect(current_path).to eq(new_user_path) + expect(page).to have_current_path(new_user_path, ignore_query: true) expect(find('.user-info')).to have_content(new_username) end @@ -77,14 +77,14 @@ RSpec.describe 'Profile > Account', :js do it 'the project is accessible via the new path' do update_username(new_username) visit new_project_path - expect(current_path).to eq(new_project_path) + expect(page).to have_current_path(new_project_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(user.name) end it 'the old project path redirects to the new path' do update_username(new_username) visit old_project_path - expect(current_path).to eq(new_project_path) + expect(page).to have_current_path(new_project_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(user.name) end end diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index b392d8dfa8e..82134de582a 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -28,7 +28,7 @@ RSpec.describe 'Profile > Chat' do end it 'goes to list of chat names and see chat account' do - expect(page.current_path).to eq(profile_chat_names_path) + expect(page).to have_current_path(profile_chat_names_path, ignore_query: true) expect(page).to have_content('my_chat_team') expect(page).to have_content('my_chat_user') end @@ -46,7 +46,7 @@ RSpec.describe 'Profile > Chat' do end it 'goes to list of chat names and do not see chat account' do - expect(page.current_path).to eq(profile_chat_names_path) + expect(page).to have_current_path(profile_chat_names_path, ignore_query: true) expect(page).not_to have_content('my_chat_team') expect(page).not_to have_content('my_chat_user') end diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 898e2c2aa59..2181285f771 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -104,7 +104,7 @@ RSpec.describe 'Profile > Password' do expect(user.failed_attempts).to eq(1) expect(user.valid_password?(new_password)).to eq(false) - expect(current_path).to eq(edit_profile_password_path) + expect(page).to have_current_path(edit_profile_password_path, ignore_query: true) page.within '.flash-container' do expect(page).to have_content('You must provide a valid current password') @@ -116,7 +116,7 @@ RSpec.describe 'Profile > Password' do subject - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) page.within '.flash-container' do expect(page).to have_content('Your account is locked.') @@ -146,7 +146,7 @@ RSpec.describe 'Profile > Password' do it 'changes the password, logs the user out and prompts them to sign in again', :aggregate_failures do expect { subject }.to change { user.reload.valid_password?(new_password) }.to(true) - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true page.within '.flash-container' do expect(page).to have_content('Password was successfully updated. Please sign in again.') @@ -167,14 +167,14 @@ RSpec.describe 'Profile > Password' do it 'needs change user password' do visit edit_profile_password_path - expect(current_path).to eq new_profile_password_path + expect(page).to have_current_path new_profile_password_path, ignore_query: true fill_in :user_password, with: user.password fill_in :user_new_password, with: Gitlab::Password.test_default fill_in :user_password_confirmation, with: Gitlab::Password.test_default click_button 'Set new password' - expect(current_path).to eq new_user_session_path + expect(page).to have_current_path new_user_session_path, ignore_query: true end context 'when global require_two_factor_authentication is enabled' do @@ -183,7 +183,7 @@ RSpec.describe 'Profile > Password' do visit profile_path - expect(current_path).to eq new_profile_password_path + expect(page).to have_current_path new_profile_password_path, ignore_query: true end end end 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 da63f7c0f41..e19e29bf63a 100644 --- a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb @@ -55,12 +55,12 @@ RSpec.describe 'User visits the profile preferences page', :js do find('#logo').click expect(page).to have_content("You don't have starred projects yet") - expect(page.current_path).to eq starred_dashboard_projects_path + expect(page).to have_current_path starred_dashboard_projects_path, ignore_query: true find('.shortcuts-activity').click expect(page).not_to have_content("You don't have starred projects yet") - expect(page.current_path).to eq dashboard_projects_path + expect(page).to have_current_path dashboard_projects_path, ignore_query: true end end diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb index b61ee623fec..f97c1b0e543 100644 --- a/spec/features/projects/artifacts/file_spec.rb +++ b/spec/features/projects/artifacts/file_spec.rb @@ -73,7 +73,7 @@ RSpec.describe 'Artifact file', :js do end it "redirects to new URL" do - expect(page.current_path).to eq(file_url) + expect(page).to have_current_path(file_url, ignore_query: true) end end end diff --git a/spec/features/projects/artifacts/raw_spec.rb b/spec/features/projects/artifacts/raw_spec.rb index d580262d48b..c10cb56a44b 100644 --- a/spec/features/projects/artifacts/raw_spec.rb +++ b/spec/features/projects/artifacts/raw_spec.rb @@ -21,7 +21,7 @@ RSpec.describe 'Raw artifact' do end it "redirects to new URL" do - expect(page.current_path).to eq(raw_url) + expect(page).to have_current_path(raw_url, ignore_query: true) end end end diff --git a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb index 77e3c7f972d..2d09f5a4263 100644 --- a/spec/features/projects/artifacts/user_browses_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_browses_artifacts_spec.rb @@ -12,7 +12,7 @@ RSpec.describe "User browses artifacts" do it "redirects to new URL" do visit(browse_url.sub("/-/jobs", "/builds")) - expect(page.current_path).to eq(browse_url) + expect(page).to have_current_path(browse_url, ignore_query: true) end end 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 138e426e909..c9ba8cbd2bb 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 @@ -31,8 +31,8 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do fill_in :commit_message, with: 'Add a LICENSE file', visible: true click_button 'Commit changes' - expect(current_path).to eq( - project_blob_path(project, 'master/LICENSE')) + expect(page).to have_current_path( + project_blob_path(project, 'master/LICENSE'), ignore_query: true) expect(page).to have_content('MIT License') expect(page).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") end @@ -41,8 +41,8 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do click_link 'Add LICENSE' expect(page).to have_content('New file') - expect(current_path).to eq( - project_new_blob_path(project, 'master')) + expect(page).to have_current_path( + project_new_blob_path(project, 'master'), ignore_query: true) expect(find('#file_name').value).to eq('LICENSE') expect(page).to have_selector('.license-selector') @@ -55,8 +55,8 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do fill_in :commit_message, with: 'Add a LICENSE file', visible: true click_button 'Commit changes' - expect(current_path).to eq( - project_blob_path(project, 'master/LICENSE')) + expect(page).to have_current_path( + project_blob_path(project, 'master/LICENSE'), ignore_query: true) expect(page).to have_content('MIT License') expect(page).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") end 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 2b44eb59d71..0e87622d3c2 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 @@ -16,7 +16,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license visit project_path(project) click_on 'Add LICENSE' - expect(current_path).to eq("/-/ide/project/#{project.full_path}/edit/master/-/LICENSE") + expect(page).to have_current_path("/-/ide/project/#{project.full_path}/edit/master/-/LICENSE", ignore_query: true) expect(page).to have_selector('.qa-file-templates-bar') # rubocop:disable QA/SelectorUsage @@ -27,7 +27,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license ide_commit - expect(current_path).to eq("/-/ide/project/#{project.full_path}/tree/master/-/LICENSE/") + expect(page).to have_current_path("/-/ide/project/#{project.full_path}/tree/master/-/LICENSE/", ignore_query: true) expect(page).to have_content('All changes are committed') diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 9b4d1502bc8..53fdd5a15dd 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -76,7 +76,7 @@ RSpec.describe "User browses files", :js do permalink_path = project_blob_path(project, "#{project.repository.commit.sha}/.gitignore") - expect(current_path).to eq(permalink_path) + expect(page).to have_current_path(permalink_path, ignore_query: true) end end @@ -87,7 +87,7 @@ RSpec.describe "User browses files", :js do end it "shows correct files and links" do - expect(current_path).to eq(project_tree_path(project, "markdown")) + expect(page).to have_current_path(project_tree_path(project, "markdown"), ignore_query: true) expect(page).to have_content("README.md") .and have_content("CHANGELOG") .and have_content("Welcome to GitLab GitLab is a free project and repository management application") @@ -108,7 +108,7 @@ RSpec.describe "User browses files", :js do it "shows correct content of file" do click_link("GitLab API doc") - expect(current_path).to eq(project_blob_path(project, "markdown/doc/api/README.md")) + expect(page).to have_current_path(project_blob_path(project, "markdown/doc/api/README.md"), ignore_query: true) expect(page).to have_content("All API requests require authentication") .and have_content("Contents") .and have_link("Users") @@ -117,19 +117,19 @@ RSpec.describe "User browses files", :js do click_link("Users") - expect(current_path).to eq(project_blob_path(project, "markdown/doc/api/users.md")) + expect(page).to have_current_path(project_blob_path(project, "markdown/doc/api/users.md"), ignore_query: true) expect(page).to have_content("Get a list of users.") page.go_back click_link("Rake tasks") - expect(current_path).to eq(project_tree_path(project, "markdown/doc/raketasks")) + expect(page).to have_current_path(project_tree_path(project, "markdown/doc/raketasks"), ignore_query: true) expect(page).to have_content("backup_restore.md").and have_content("maintenance.md") click_link("maintenance.md") - expect(current_path).to eq(project_blob_path(project, "markdown/doc/raketasks/maintenance.md")) + expect(page).to have_current_path(project_blob_path(project, "markdown/doc/raketasks/maintenance.md"), ignore_query: true) expect(page).to have_content("bundle exec rake gitlab:env:info RAILS_ENV=production") click_link("shop") @@ -156,12 +156,12 @@ RSpec.describe "User browses files", :js do it "shows correct content of directory" do click_link("GitLab API doc directory") - expect(current_path).to eq(project_tree_path(project, "markdown/doc/api")) + expect(page).to have_current_path(project_tree_path(project, "markdown/doc/api"), ignore_query: true) expect(page).to have_content("README.md").and have_content("users.md") click_link("Users") - expect(current_path).to eq(project_blob_path(project, "markdown/doc/api/users.md")) + expect(page).to have_current_path(project_blob_path(project, "markdown/doc/api/users.md"), ignore_query: true) expect(page).to have_content("List users").and have_content("Get a list of users.") end end @@ -267,7 +267,7 @@ RSpec.describe "User browses files", :js do end it "shows files from a repository for `6d39438`" do - expect(current_path).to eq(ref) + expect(page).to have_current_path(ref, ignore_query: true) expect(page).to have_content(".gitignore").and have_content("LICENSE") end diff --git a/spec/features/projects/files/user_creates_directory_spec.rb b/spec/features/projects/files/user_creates_directory_spec.rb index 5ad7641a5be..9e0168d7ef3 100644 --- a/spec/features/projects/files/user_creates_directory_spec.rb +++ b/spec/features/projects/files/user_creates_directory_spec.rb @@ -42,7 +42,7 @@ RSpec.describe 'Projects > Files > User creates a directory', :js do click_button('Create directory') expect(page).to have_content('A directory with this name already exists') - expect(current_path).to eq(project_tree_path(project, 'master')) + expect(page).to have_current_path(project_tree_path(project, 'master'), ignore_query: true) end end @@ -81,7 +81,7 @@ RSpec.describe 'Projects > Files > User creates a directory', :js do expect(page).to have_content('From new-feature into master') expect(page).to have_content('Add new directory') - expect(current_path).to eq(project_new_merge_request_path(project)) + expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true) end end @@ -107,7 +107,7 @@ RSpec.describe 'Projects > Files > User creates a directory', :js do fork = user.fork_of(project2.reload) wait_for_requests - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) end end end diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb index 7159418deda..7344c91b6dc 100644 --- a/spec/features/projects/files/user_creates_files_spec.rb +++ b/spec/features/projects/files/user_creates_files_spec.rb @@ -97,7 +97,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do new_file_path = project_blob_path(project, 'master/not_a_file.md') - expect(current_path).to eq(new_file_path) + expect(page).to have_current_path(new_file_path, ignore_query: true) wait_for_requests @@ -115,7 +115,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do new_file_path = project_blob_path(project, 'master/not_a_file.md') - expect(current_path).to eq(new_file_path) + expect(page).to have_current_path(new_file_path, ignore_query: true) click_link('Edit') @@ -133,7 +133,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do fill_in(:commit_message, with: 'New commit message', visible: true) click_button('Commit changes') - expect(current_path).to eq(project_blob_path(project, 'master/foo/bar/baz.txt')) + expect(page).to have_current_path(project_blob_path(project, 'master/foo/bar/baz.txt'), ignore_query: true) wait_for_requests @@ -150,7 +150,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do fill_in(:branch_name, with: 'new_branch_name', visible: true) click_button('Commit changes') - expect(current_path).to eq(project_new_merge_request_path(project)) + expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true) click_link('Changes') @@ -187,7 +187,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do fork = user.fork_of(project2.reload) - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) expect(page).to have_content('New commit message') end end diff --git a/spec/features/projects/files/user_deletes_files_spec.rb b/spec/features/projects/files/user_deletes_files_spec.rb index b6e300e9e59..806f1e8e9ed 100644 --- a/spec/features/projects/files/user_deletes_files_spec.rb +++ b/spec/features/projects/files/user_deletes_files_spec.rb @@ -34,7 +34,7 @@ RSpec.describe 'Projects > Files > User deletes files', :js do fill_in(:commit_message, with: 'New commit message', visible: true) click_button('Delete file') - expect(current_path).to eq(project_tree_path(project, 'master/')) + expect(page).to have_current_path(project_tree_path(project, 'master/'), ignore_query: true) expect(page).not_to have_content('.gitignore') end end @@ -66,7 +66,7 @@ RSpec.describe 'Projects > Files > User deletes files', :js do fork = user.fork_of(project2.reload) - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) expect(page).to have_content('New commit message') end end diff --git a/spec/features/projects/files/user_edits_files_spec.rb b/spec/features/projects/files/user_edits_files_spec.rb index d74f40d29bb..1ac45970828 100644 --- a/spec/features/projects/files/user_edits_files_spec.rb +++ b/spec/features/projects/files/user_edits_files_spec.rb @@ -77,7 +77,7 @@ RSpec.describe 'Projects > Files > User edits files', :js do fill_in(:commit_message, with: 'New commit message', visible: true) click_button('Commit changes') - expect(current_path).to eq(project_blob_path(project, 'master/.gitignore')) + expect(page).to have_current_path(project_blob_path(project, 'master/.gitignore'), ignore_query: true) wait_for_requests @@ -97,7 +97,7 @@ RSpec.describe 'Projects > Files > User edits files', :js do fill_in(:branch_name, with: 'new_branch_name', visible: true) click_button('Commit changes') - expect(current_path).to eq(project_new_merge_request_path(project)) + expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true) click_link('Changes') @@ -194,7 +194,7 @@ RSpec.describe 'Projects > Files > User edits files', :js do fork = user.fork_of(project2.reload) - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) wait_for_requests @@ -223,7 +223,7 @@ RSpec.describe 'Projects > Files > User edits files', :js do fork = user.fork_of(project2) - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) wait_for_requests diff --git a/spec/features/projects/files/user_replaces_files_spec.rb b/spec/features/projects/files/user_replaces_files_spec.rb index daa63f53ddd..1ecd50b6463 100644 --- a/spec/features/projects/files/user_replaces_files_spec.rb +++ b/spec/features/projects/files/user_replaces_files_spec.rb @@ -81,7 +81,7 @@ RSpec.describe 'Projects > Files > User replaces files', :js do fork = user.fork_of(project2.reload) - expect(current_path).to eq(project_new_merge_request_path(fork)) + expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true) click_link('Changes') diff --git a/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb b/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb index b9c2c539899..2821f35f6a6 100644 --- a/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb +++ b/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb @@ -34,7 +34,7 @@ RSpec.describe 'User activates issue tracker', :js do it 'activates the integration' do expect(page).to have_content("#{tracker} settings saved and active.") - expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_'))) + expect(page).to have_current_path(edit_project_integration_path(project, tracker.parameterize(separator: '_')), ignore_query: true) end it 'shows the link in the menu' do @@ -58,7 +58,7 @@ RSpec.describe 'User activates issue tracker', :js do end expect(page).to have_content("#{tracker} settings saved and active.") - expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_'))) + expect(page).to have_current_path(edit_project_integration_path(project, tracker.parameterize(separator: '_')), ignore_query: true) end end end @@ -73,7 +73,7 @@ RSpec.describe 'User activates issue tracker', :js do it 'saves but does not activate the integration' do expect(page).to have_content("#{tracker} settings saved, but not active.") - expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_'))) + expect(page).to have_current_path(edit_project_integration_path(project, tracker.parameterize(separator: '_')), ignore_query: true) end it 'does not show the external tracker link in the menu' do diff --git a/spec/features/projects/integrations/user_activates_jira_spec.rb b/spec/features/projects/integrations/user_activates_jira_spec.rb index 7562dc00092..f855d6befe7 100644 --- a/spec/features/projects/integrations/user_activates_jira_spec.rb +++ b/spec/features/projects/integrations/user_activates_jira_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'User activates Jira', :js do it 'activates the Jira integration' do expect(page).to have_content('Jira settings saved and active.') - expect(current_path).to eq(edit_project_integration_path(project, :jira)) + expect(page).to have_current_path(edit_project_integration_path(project, :jira), ignore_query: true) end unless Gitlab.ee? @@ -55,7 +55,7 @@ RSpec.describe 'User activates Jira', :js do click_test_then_save_integration expect(page).to have_content('Jira settings saved and active.') - expect(current_path).to eq(edit_project_integration_path(project, :jira)) + expect(page).to have_current_path(edit_project_integration_path(project, :jira), ignore_query: true) end end end @@ -72,7 +72,7 @@ RSpec.describe 'User activates Jira', :js do it 'saves but does not activate the Jira integration' do expect(page).to have_content('Jira settings saved, but not active.') - expect(current_path).to eq(edit_project_integration_path(project, :jira)) + expect(page).to have_current_path(edit_project_integration_path(project, :jira), ignore_query: true) end it 'does not show the Jira link in the menu' do diff --git a/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb b/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb index 7ec469070ea..0b4c9620bdf 100644 --- a/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb +++ b/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb @@ -24,7 +24,7 @@ RSpec.describe 'Slack slash commands', :js do click_active_checkbox click_on 'Save' - expect(current_path).to eq(edit_project_integration_path(project, :slack_slash_commands)) + expect(page).to have_current_path(edit_project_integration_path(project, :slack_slash_commands), ignore_query: true) expect(page).to have_content('Slack slash commands settings saved, but not active.') end @@ -32,7 +32,7 @@ RSpec.describe 'Slack slash commands', :js do fill_in 'Token', with: 'token' click_on 'Save' - expect(current_path).to eq(edit_project_integration_path(project, :slack_slash_commands)) + expect(page).to have_current_path(edit_project_integration_path(project, :slack_slash_commands), ignore_query: true) expect(page).to have_content('Slack slash commands settings saved and active.') end diff --git a/spec/features/projects/jobs/user_browses_jobs_spec.rb b/spec/features/projects/jobs/user_browses_jobs_spec.rb index a47aab1ec70..fde6240d373 100644 --- a/spec/features/projects/jobs/user_browses_jobs_spec.rb +++ b/spec/features/projects/jobs/user_browses_jobs_spec.rb @@ -270,7 +270,7 @@ RSpec.describe 'User browses jobs' do wait_for_requests expect(page).to have_content 'You need to sign in' - expect(page.current_path).to eq("/users/sign_in") + expect(page).to have_current_path("/users/sign_in") end end end diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 90b64cde935..b34a615e651 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -103,7 +103,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do end it "redirects to new URL" do - expect(page.current_path).to eq(jobs_url) + expect(page).to have_current_path(jobs_url, ignore_query: true) end end end @@ -315,7 +315,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do it 'shows cancel button' do find('[data-testid="cancel-button"]').click - expect(page.current_path).to eq(job_url) + expect(page).to have_current_path(job_url, ignore_query: true) end end end @@ -459,7 +459,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do end it "redirects to new URL" do - expect(page.current_path).to eq(job_url) + expect(page).to have_current_path(job_url, ignore_query: true) end end @@ -1179,7 +1179,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do end it "redirects to new URL" do - expect(page.current_path).to eq(raw_job_url) + expect(page).to have_current_path(raw_job_url, ignore_query: true) end end end diff --git a/spec/features/projects/members/member_leaves_project_spec.rb b/spec/features/projects/members/member_leaves_project_spec.rb index c38292f81bf..78a0a384d2c 100644 --- a/spec/features/projects/members/member_leaves_project_spec.rb +++ b/spec/features/projects/members/member_leaves_project_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'Projects > Members > Member leaves project' do click_link 'Leave project' - expect(current_path).to eq(dashboard_projects_path) + expect(page).to have_current_path(dashboard_projects_path, ignore_query: true) expect(project.users.exists?(user.id)).to be_falsey end @@ -29,7 +29,7 @@ RSpec.describe 'Projects > Members > Member leaves project' do page.accept_confirm wait_for_all_requests - expect(current_path).to eq(dashboard_projects_path) + expect(page).to have_current_path(dashboard_projects_path, ignore_query: true) sign_in(project.first_owner) diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 7428b76dca4..c57e39b6508 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -372,7 +372,7 @@ RSpec.describe 'New project', :js do it 'shows import instructions' do expect(page).to have_content('Authenticate with GitHub') - expect(current_path).to eq new_import_github_path + expect(page).to have_current_path new_import_github_path, ignore_query: true end end @@ -383,7 +383,7 @@ RSpec.describe 'New project', :js do it 'shows import instructions' do expect(page).to have_content('Manifest file import') - expect(current_path).to eq new_import_manifest_path + expect(page).to have_current_path new_import_manifest_path, ignore_query: true end end end diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 7b6f22cbe5f..6b9dfdf3a7b 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -477,7 +477,7 @@ RSpec.describe 'Pipeline', :js do it 'redirects to pipeline overview page', :sidekiq_inline do expect(page).to have_content('The pipeline has been deleted') - expect(current_path).to eq(project_pipelines_path(project)) + expect(page).to have_current_path(project_pipelines_path(project), ignore_query: true) end end @@ -1124,7 +1124,7 @@ RSpec.describe 'Pipeline', :js do it 'displays the pipeline graph' do subject - expect(current_path).to eq(pipeline_path(pipeline)) + expect(page).to have_current_path(pipeline_path(pipeline), ignore_query: true) expect(page).not_to have_content('Failed Jobs') expect(page).to have_selector('.js-pipeline-graph') end diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index c031942dbb3..83f3b7b3826 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -937,7 +937,7 @@ RSpec.describe 'Pipelines', :js do it 'redirects the user to sign_in and displays the flash alert' do expect(page).to have_content 'You need to sign in' - expect(page.current_path).to eq("/users/sign_in") + expect(page).to have_current_path("/users/sign_in") end end end 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 d16295aedbe..0fc12f93850 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 @@ -20,7 +20,7 @@ RSpec.describe "User interacts with deploy keys", :js do click_button("Enable") expect(page).not_to have_selector(".gl-spinner") - expect(current_path).to eq(project_settings_repository_path(project)) + expect(page).to have_current_path(project_settings_repository_path(project), ignore_query: true) find(".js-deployKeys-tab-enabled_keys").click @@ -96,7 +96,7 @@ RSpec.describe "User interacts with deploy keys", :js do click_button("Add key") - expect(current_path).to eq(project_settings_repository_path(project)) + expect(page).to have_current_path(project_settings_repository_path(project), ignore_query: true) page.within(".deploy-keys") do expect(page).to have_content(deploy_key_title) 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 1ff976eb800..2e2d7119e2e 100644 --- a/spec/features/projects/settings/user_renames_a_project_spec.rb +++ b/spec/features/projects/settings/user_renames_a_project_spec.rb @@ -82,7 +82,7 @@ RSpec.describe 'Projects > Settings > User renames a project' do new_path = namespace_project_path(project.namespace, 'bar') visit new_path - expect(current_path).to eq(new_path) + expect(page).to have_current_path(new_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.name) end @@ -92,7 +92,7 @@ RSpec.describe 'Projects > Settings > User renames a project' do new_path = namespace_project_path(project.namespace, 'bar') visit old_path - expect(current_path).to eq(new_path) + expect(page).to have_current_path(new_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.name) end @@ -103,7 +103,7 @@ RSpec.describe 'Projects > Settings > User renames a project' do new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') visit old_path - expect(current_path).to eq(old_path) + expect(page).to have_current_path(old_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(new_project.name) end end 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 a88b9101869..6041dca305b 100644 --- a/spec/features/projects/settings/user_transfers_a_project_spec.rb +++ b/spec/features/projects/settings/user_transfers_a_project_spec.rb @@ -51,13 +51,13 @@ RSpec.describe 'Projects > Settings > User transfers a project', :js do visit new_path wait_for_requests - expect(current_path).to eq(new_path) + expect(page).to have_current_path(new_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.name) visit old_path wait_for_requests - expect(current_path).to eq(new_path) + expect(page).to have_current_path(new_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(project.name) end @@ -69,7 +69,7 @@ RSpec.describe 'Projects > Settings > User transfers a project', :js do new_project = create(:project, namespace: user.namespace, path: project_path) visit old_path - expect(current_path).to eq(old_path) + expect(page).to have_current_path(old_path, ignore_query: true) expect(find('.breadcrumbs')).to have_content(new_project.name) end end diff --git a/spec/features/projects/settings/webhooks_settings_spec.rb b/spec/features/projects/settings/webhooks_settings_spec.rb index 8d73ffecd46..c84de7fc03f 100644 --- a/spec/features/projects/settings/webhooks_settings_spec.rb +++ b/spec/features/projects/settings/webhooks_settings_spec.rb @@ -86,7 +86,7 @@ RSpec.describe 'Projects > Settings > Webhook Settings' do find('.hook-test-button.dropdown').click click_link 'Push events' - expect(current_path).to eq(webhooks_path) + expect(page).to have_current_path(webhooks_path, ignore_query: true) end context 'delete existing webhook' do @@ -137,7 +137,7 @@ RSpec.describe 'Projects > Settings > Webhook Settings' do click_link 'View details' click_link 'Resend Request' - expect(current_path).to eq(edit_project_hook_path(project, hook)) + expect(page).to have_current_path(edit_project_hook_path(project, hook), ignore_query: true) end end end diff --git a/spec/features/projects/show/redirects_spec.rb b/spec/features/projects/show/redirects_spec.rb index 3ac82244ded..55069cdd6c5 100644 --- a/spec/features/projects/show/redirects_spec.rb +++ b/spec/features/projects/show/redirects_spec.rb @@ -22,13 +22,13 @@ RSpec.describe 'Projects > Show > Redirects' do it 'redirects to sign in page when project is private' do visit project_path(private_project) - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) end it 'redirects to sign in page when project does not exist' do visit project_path(build(:project, :public)) - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) end it 'redirects to public project page after signing in' do @@ -41,7 +41,7 @@ RSpec.describe 'Projects > Show > Redirects' do click_button 'Sign in' expect(status_code).to eq(200) - expect(current_path).to eq("/#{public_project.full_path}") + expect(page).to have_current_path("/#{public_project.full_path}", ignore_query: true) end it 'redirects to private project page after sign in' do @@ -53,7 +53,7 @@ RSpec.describe 'Projects > Show > Redirects' do click_button 'Sign in' expect(status_code).to eq(200) - expect(current_path).to eq("/#{private_project.full_path}") + expect(page).to have_current_path("/#{private_project.full_path}", ignore_query: true) end context 'when signed in' do 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 99f84c19bf3..aa61b629d92 100644 --- a/spec/features/projects/show/user_interacts_with_stars_spec.rb +++ b/spec/features/projects/show/user_interacts_with_stars_spec.rb @@ -34,7 +34,7 @@ RSpec.describe 'Projects > Show > User interacts with project stars' do find('.star-btn').click - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) end end end 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 5270939f681..608bb4c5997 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Projects > Show > User sees Git instructions' do shared_examples_for 'redirects to the sign in page' do it 'redirects to the sign in page' do - expect(current_path).to eq(new_user_session_path) + expect(page).to have_current_path(new_user_session_path, ignore_query: true) end end diff --git a/spec/features/projects/tags/user_views_tags_spec.rb b/spec/features/projects/tags/user_views_tags_spec.rb index ef363ab6158..e1962ad3df5 100644 --- a/spec/features/projects/tags/user_views_tags_spec.rb +++ b/spec/features/projects/tags/user_views_tags_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'User views tags', :feature do it do visit project_tags_path(project, format: :atom) - expect(page.current_path).to eq("/users/sign_in") + expect(page).to have_current_path("/users/sign_in") end end diff --git a/spec/features/projects/user_creates_project_spec.rb b/spec/features/projects/user_creates_project_spec.rb index c4e2e3353a4..6491a7425f7 100644 --- a/spec/features/projects/user_creates_project_spec.rb +++ b/spec/features/projects/user_creates_project_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'User creates a project', :js do project = Project.last - expect(current_path).to eq(project_path(project)) + expect(page).to have_current_path(project_path(project), ignore_query: true) expect(page).to have_content('Empty') expect(page).to have_content('git init') expect(page).to have_content('git remote') @@ -47,7 +47,7 @@ RSpec.describe 'User creates a project', :js do project = Project.last - expect(current_path).to eq(project_path(project)) + expect(page).to have_current_path(project_path(project), ignore_query: true) expect(page).to have_content('With initial commits') expect(page).to have_content('Configure SAST in `.gitlab-ci.yml`, creating this file if it does not already exist') expect(page).to have_content('README.md Initial commit') @@ -72,7 +72,7 @@ RSpec.describe 'User creates a project', :js do project = Project.last - expect(current_path).to eq(project_path(project)) + expect(page).to have_current_path(project_path(project), ignore_query: true) expect(page).to have_content('With initial commits') expect(page).to have_content('Configure SAST in `.gitlab-ci.yml`, creating this file if it does not already exist') expect(page).to have_content('README.md Initial commit') diff --git a/spec/features/tags/developer_creates_tag_spec.rb b/spec/features/tags/developer_creates_tag_spec.rb index f982d403ce1..b0219cb546d 100644 --- a/spec/features/tags/developer_creates_tag_spec.rb +++ b/spec/features/tags/developer_creates_tag_spec.rb @@ -38,8 +38,8 @@ RSpec.describe 'Developer creates tag' do it 'with multiline message displays the message in a
 block' do
       create_tag_in_form(tag: 'v3.0', ref: 'master', message: "Awesome tag message\n\n- hello\n- world")
 
-      expect(current_path).to eq(
-        project_tag_path(project, 'v3.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v3.0'), ignore_query: true)
       expect(page).to have_content 'v3.0'
       page.within 'pre.wrap' do
         expect(page).to have_content "Awesome tag message - hello - world"
@@ -49,8 +49,8 @@ RSpec.describe 'Developer creates tag' do
     it 'with multiline release notes parses the release note as Markdown' do
       create_tag_in_form(tag: 'v4.0', ref: 'master', desc: "Awesome release notes\n\n- hello\n- world")
 
-      expect(current_path).to eq(
-        project_tag_path(project, 'v4.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v4.0'), ignore_query: true)
       expect(page).to have_content 'v4.0'
       page.within '.description' do
         expect(page).to have_content 'Awesome release notes'
diff --git a/spec/features/tags/developer_deletes_tag_spec.rb b/spec/features/tags/developer_deletes_tag_spec.rb
index 7c4c6f54685..6b669695f7b 100644
--- a/spec/features/tags/developer_deletes_tag_spec.rb
+++ b/spec/features/tags/developer_deletes_tag_spec.rb
@@ -27,13 +27,13 @@ RSpec.describe 'Developer deletes tag', :js do
   context 'from a specific tag page' do
     it 'deletes the tag' do
       click_on 'v1.0.0'
-      expect(current_path).to eq(
-        project_tag_path(project, 'v1.0.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v1.0.0'), ignore_query: true)
 
       container = page.find('.nav-controls')
       delete_tag container
 
-      expect(current_path).to eq("#{project_tags_path(project)}/")
+      expect(page).to have_current_path("#{project_tags_path(project)}/", ignore_query: true)
       expect(page).not_to have_content 'v1.0.0'
     end
   end
diff --git a/spec/features/tags/developer_updates_tag_spec.rb b/spec/features/tags/developer_updates_tag_spec.rb
index 93a275131bd..b2fc28b8493 100644
--- a/spec/features/tags/developer_updates_tag_spec.rb
+++ b/spec/features/tags/developer_updates_tag_spec.rb
@@ -20,8 +20,8 @@ RSpec.describe 'Developer updates tag' do
       fill_in 'release_description', with: 'Awesome release notes'
       click_button 'Save changes'
 
-      expect(current_path).to eq(
-        project_tag_path(project, 'v1.1.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v1.1.0'), ignore_query: true)
       expect(page).to have_content 'v1.1.0'
       expect(page).to have_content 'Awesome release notes'
     end
@@ -45,8 +45,8 @@ RSpec.describe 'Developer updates tag' do
       fill_in 'release_description', with: 'Awesome release notes'
       click_button 'Save changes'
 
-      expect(current_path).to eq(
-        project_tag_path(project, 'v1.1.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v1.1.0'), ignore_query: true)
       expect(page).to have_content 'v1.1.0'
       expect(page).to have_content 'Awesome release notes'
     end
diff --git a/spec/features/tags/developer_views_tags_spec.rb b/spec/features/tags/developer_views_tags_spec.rb
index 6bae53afe6f..57e1f7da04e 100644
--- a/spec/features/tags/developer_views_tags_spec.rb
+++ b/spec/features/tags/developer_views_tags_spec.rb
@@ -55,8 +55,8 @@ RSpec.describe 'Developer views tags' do
     it 'views a specific tag page' do
       click_on 'v1.0.0'
 
-      expect(current_path).to eq(
-        project_tag_path(project, 'v1.0.0'))
+      expect(page).to have_current_path(
+        project_tag_path(project, 'v1.0.0'), ignore_query: true)
       expect(page).to have_content 'v1.0.0'
       expect(page).to have_content 'This tag has no release notes.'
     end
@@ -65,25 +65,25 @@ RSpec.describe 'Developer views tags' do
       it 'has a button to browse files' do
         click_on 'v1.0.0'
 
-        expect(current_path).to eq(
-          project_tag_path(project, 'v1.0.0'))
+        expect(page).to have_current_path(
+          project_tag_path(project, 'v1.0.0'), ignore_query: true)
 
         click_on 'Browse files'
 
-        expect(current_path).to eq(
-          project_tree_path(project, 'v1.0.0'))
+        expect(page).to have_current_path(
+          project_tree_path(project, 'v1.0.0'), ignore_query: true)
       end
 
       it 'has a button to browse commits' do
         click_on 'v1.0.0'
 
-        expect(current_path).to eq(
-          project_tag_path(project, 'v1.0.0'))
+        expect(page).to have_current_path(
+          project_tag_path(project, 'v1.0.0'), ignore_query: true)
 
         click_on 'Browse commits'
 
-        expect(current_path).to eq(
-          project_commits_path(project, 'v1.0.0'))
+        expect(page).to have_current_path(
+          project_commits_path(project, 'v1.0.0'), ignore_query: true)
       end
     end
   end
diff --git a/spec/features/unsubscribe_links_spec.rb b/spec/features/unsubscribe_links_spec.rb
index b7471720008..3fe276ce162 100644
--- a/spec/features/unsubscribe_links_spec.rb
+++ b/spec/features/unsubscribe_links_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe 'Unsubscribe links', :sidekiq_might_not_need_inline do
       it 'shows the unsubscribe confirmation page and redirects to root path when confirming' do
         visit body_link
 
-        expect(current_path).to eq unsubscribe_sent_notification_path(SentNotification.last)
+        expect(page).to have_current_path unsubscribe_sent_notification_path(SentNotification.last), ignore_query: true
         expect(page).to have_text(%(Unsubscribe from issue))
         expect(page).to have_text(%(Are you sure you want to unsubscribe from the issue: #{issue.title} (#{issue.to_reference})?))
         expect(issue.subscribed?(recipient, project)).to be_truthy
@@ -33,19 +33,19 @@ RSpec.describe 'Unsubscribe links', :sidekiq_might_not_need_inline do
         click_link 'Unsubscribe'
 
         expect(issue.subscribed?(recipient, project)).to be_falsey
-        expect(current_path).to eq new_user_session_path
+        expect(page).to have_current_path new_user_session_path, ignore_query: true
       end
 
       it 'shows the unsubscribe confirmation page and redirects to root path when canceling' do
         visit body_link
 
-        expect(current_path).to eq unsubscribe_sent_notification_path(SentNotification.last)
+        expect(page).to have_current_path unsubscribe_sent_notification_path(SentNotification.last), ignore_query: true
         expect(issue.subscribed?(recipient, project)).to be_truthy
 
         click_link 'Cancel'
 
         expect(issue.subscribed?(recipient, project)).to be_truthy
-        expect(current_path).to eq new_user_session_path
+        expect(page).to have_current_path new_user_session_path, ignore_query: true
       end
     end
 
diff --git a/spec/features/users/active_sessions_spec.rb b/spec/features/users/active_sessions_spec.rb
index 6dc93fe017f..c722a4ec05c 100644
--- a/spec/features/users/active_sessions_spec.rb
+++ b/spec/features/users/active_sessions_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe 'Active user sessions', :clean_gitlab_redis_sessions do
     Timecop.freeze(now) do
       user = create(:user)
       gitlab_sign_in(user)
-      expect(current_path).to eq root_path
+      expect(page).to have_current_path root_path, ignore_query: true
 
       sessions = ActiveSession.list(user)
       expect(sessions.count).to eq 1
@@ -59,12 +59,12 @@ RSpec.describe 'Active user sessions', :clean_gitlab_redis_sessions do
   it 'logout deletes the active user login' do
     user = create(:user)
     gitlab_sign_in(user)
-    expect(current_path).to eq root_path
+    expect(page).to have_current_path root_path, ignore_query: true
 
     expect(ActiveSession.list(user).count).to eq 1
 
     gitlab_sign_out
-    expect(current_path).to eq new_user_session_path
+    expect(page).to have_current_path new_user_session_path, ignore_query: true
 
     expect(ActiveSession.list(user)).to be_empty
   end
diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb
index 98191c7d4db..062e79ea91a 100644
--- a/spec/features/users/login_spec.rb
+++ b/spec/features/users/login_spec.rb
@@ -28,7 +28,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
       expect(user.reset_password_token).not_to be_nil
 
       gitlab_sign_in(user)
-      expect(current_path).to eq root_path
+      expect(page).to have_current_path root_path, ignore_query: true
 
       user.reload
       expect(user.reset_password_token).to be_nil
@@ -46,14 +46,14 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
       user = create(:admin, password_automatically_set: true)
 
       visit root_path
-      expect(current_path).to eq edit_user_password_path
+      expect(page).to have_current_path edit_user_password_path, ignore_query: true
       expect(page).to have_content('Please create a password for your new account.')
 
       fill_in 'user_password',              with: Gitlab::Password.test_default
       fill_in 'user_password_confirmation', with: Gitlab::Password.test_default
       click_button 'Change your password'
 
-      expect(current_path).to eq new_user_session_path
+      expect(page).to have_current_path new_user_session_path, ignore_query: true
       expect(page).to have_content(I18n.t('devise.passwords.updated_not_active'))
 
       fill_in 'user_login',    with: user.username
@@ -61,7 +61,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
       click_button 'Sign in'
 
       expect_single_session_with_authenticated_ttl
-      expect(current_path).to eq root_path
+      expect(page).to have_current_path root_path, ignore_query: true
     end
 
     it 'does not show flash messages when login page' do
@@ -145,7 +145,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
         fill_in 'user_email', with: user.email
         click_button 'Resend'
 
-        expect(current_path).to eq users_almost_there_path
+        expect(page).to have_current_path users_almost_there_path, ignore_query: true
       end
     end
   end
@@ -226,7 +226,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           enter_code(user.current_otp)
 
           expect_single_session_with_authenticated_ttl
-          expect(current_path).to eq root_path
+          expect(page).to have_current_path root_path, ignore_query: true
         end
 
         it 'persists remember_me value via hidden field' do
@@ -255,7 +255,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           enter_code(user.current_otp)
 
           expect_single_session_with_authenticated_ttl
-          expect(current_path).to eq root_path
+          expect(page).to have_current_path root_path, ignore_query: true
         end
 
         it 'triggers ActiveSession.cleanup for the user' do
@@ -286,7 +286,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             enter_code(codes.sample)
 
-            expect(current_path).to eq root_path
+            expect(page).to have_current_path root_path, ignore_query: true
           end
 
           it 'invalidates the used code' do
@@ -373,7 +373,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
           expect_single_session_with_authenticated_ttl
           expect(page).not_to have_content('Two-Factor Authentication')
-          expect(current_path).to eq root_path
+          expect(page).to have_current_path root_path, ignore_query: true
         end
       end
 
@@ -391,7 +391,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           enter_code(user.current_otp)
 
           expect_single_session_with_authenticated_ttl
-          expect(current_path).to eq root_path
+          expect(page).to have_current_path root_path, ignore_query: true
         end
       end
 
@@ -412,7 +412,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
         gitlab_sign_in(user)
 
         expect_single_session_with_authenticated_ttl
-        expect(current_path).to eq root_path
+        expect(page).to have_current_path root_path, ignore_query: true
         expect(page).not_to have_content(I18n.t('devise.failure.already_authenticated'))
       end
 
@@ -450,7 +450,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           fill_in 'user_password', with: Gitlab::Password.test_default
           click_button 'Sign in'
 
-          expect(current_path).to eq(new_profile_password_path)
+          expect(page).to have_current_path(new_profile_password_path, ignore_query: true)
         end
       end
     end
@@ -493,7 +493,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             expect(page).to have_content('The global settings require you to enable Two-Factor Authentication for your account. You need to do this before ')
           end
 
@@ -503,9 +503,9 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             click_link 'Configure it later'
-            expect(current_path).to eq root_path
+            expect(page).to have_current_path root_path, ignore_query: true
           end
         end
 
@@ -518,7 +518,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             expect(page).to have_content(
               'The global settings require you to enable Two-Factor Authentication for your account.'
             )
@@ -530,7 +530,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             expect(page).not_to have_link('Configure it later')
           end
         end
@@ -547,7 +547,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
           gitlab_sign_in(user)
 
-          expect(current_path).to eq profile_two_factor_auth_path
+          expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
           expect(page).to have_content(
             'The global settings require you to enable Two-Factor Authentication for your account.'
           )
@@ -576,7 +576,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
               gitlab_sign_in(user)
 
-              expect(current_path).to eq profile_two_factor_auth_path
+              expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
               expect(page).to have_content(
                 'The group settings for Group 1 and Group 2 require you to enable '\
                 'Two-Factor Authentication for your account. '\
@@ -594,9 +594,9 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             click_link 'Configure it later'
-            expect(current_path).to eq root_path
+            expect(page).to have_current_path root_path, ignore_query: true
           end
         end
 
@@ -609,7 +609,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             expect(page).to have_content(
               'The group settings for Group 1 and Group 2 require you to enable ' \
               'Two-Factor Authentication for your account.'
@@ -622,7 +622,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
             gitlab_sign_in(user)
 
-            expect(current_path).to eq profile_two_factor_auth_path
+            expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
             expect(page).not_to have_link('Configure it later')
           end
         end
@@ -639,7 +639,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
           gitlab_sign_in(user)
 
-          expect(current_path).to eq profile_two_factor_auth_path
+          expect(page).to have_current_path profile_two_factor_auth_path, ignore_query: true
           expect(page).to have_content(
             'The group settings for Group 1 and Group 2 require you to enable ' \
             'Two-Factor Authentication for your account. '\
@@ -775,7 +775,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
       click_button 'Accept terms'
 
-      expect(current_path).to eq(root_path)
+      expect(page).to have_current_path(root_path, ignore_query: true)
       expect(page).not_to have_content(I18n.t('devise.failure.already_authenticated'))
     end
 
@@ -792,7 +792,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
       click_button 'Sign in'
 
-      expect(current_path).to eq(root_path)
+      expect(page).to have_current_path(root_path, ignore_query: true)
     end
 
     context 'when 2FA is required for the user' do
@@ -816,7 +816,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           expect_to_be_on_terms_page
           click_button 'Accept terms'
 
-          expect(current_path).to eq(profile_two_factor_auth_path)
+          expect(page).to have_current_path(profile_two_factor_auth_path, ignore_query: true)
 
           fill_in 'pin_code', with: user.reload.current_otp
           fill_in 'current_password', with: user.password
@@ -825,7 +825,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           click_button 'Copy codes'
           click_link 'Proceed'
 
-          expect(current_path).to eq(profile_account_path)
+          expect(page).to have_current_path(profile_account_path, ignore_query: true)
           expect(page).to have_content('You have set up 2FA for your account! If you lose access to your 2FA device, you can use your recovery codes to access your account. Alternatively, if you upload an SSH key, you can use that key to generate additional recovery codes.')
         end
       end
@@ -853,7 +853,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
           expect_to_be_on_terms_page
           click_button 'Accept terms'
 
-          expect(current_path).to eq(root_path)
+          expect(page).to have_current_path(root_path, ignore_query: true)
         end
       end
     end
@@ -876,7 +876,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
         expect_to_be_on_terms_page
         click_button 'Accept terms'
 
-        expect(current_path).to eq(new_profile_password_path)
+        expect(page).to have_current_path(new_profile_password_path, ignore_query: true)
 
         fill_in 'user_password', with: Gitlab::Password.test_default
         fill_in 'user_new_password', with: 'new password'
@@ -903,7 +903,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
         expect_to_be_on_terms_page
         click_button 'Accept terms'
 
-        expect(current_path).to eq(profile_path)
+        expect(page).to have_current_path(profile_path, ignore_query: true)
 
         fill_in 'Email', with: 'hello@world.com'
 
@@ -931,7 +931,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
       gitlab_sign_in(user)
 
-      expect(current_path).to eq root_path
+      expect(page).to have_current_path root_path, ignore_query: true
       expect(page).to have_content("Please check your email (#{user.email}) to verify that you own this address and unlock the power of CI/CD.")
     end
 
@@ -944,7 +944,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do
 
           gitlab_sign_in(user)
 
-          expect(current_path).to eq new_user_session_path
+          expect(page).to have_current_path new_user_session_path, ignore_query: true
           expect(page).to have_content(alert_title)
           expect(page).to have_content(alert_message)
           expect(page).to have_link('Resend confirmation email', href: new_user_confirmation_path)
diff --git a/spec/features/users/logout_spec.rb b/spec/features/users/logout_spec.rb
index 3129eb5e6f3..596f0dd5a94 100644
--- a/spec/features/users/logout_spec.rb
+++ b/spec/features/users/logout_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe 'Logout/Sign out', :js do
   it 'sign out redirects to sign in page' do
     gitlab_sign_out
 
-    expect(current_path).to eq new_user_session_path
+    expect(page).to have_current_path new_user_session_path, ignore_query: true
   end
 
   it 'sign out does not show signed out flash notice' do
@@ -30,7 +30,7 @@ RSpec.describe 'Logout/Sign out', :js do
     it 'sign out redirects to sign in page' do
       gitlab_sign_out
 
-      expect(current_path).to eq new_user_session_path
+      expect(page).to have_current_path new_user_session_path, ignore_query: true
     end
   end
 end
diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb
index 013942a1fb3..3eae4955167 100644
--- a/spec/features/users/signup_spec.rb
+++ b/spec/features/users/signup_spec.rb
@@ -203,7 +203,7 @@ RSpec.describe 'Signup' do
           fill_in_signup_form
 
           expect { click_button 'Register' }.to change { User.count }.by(1)
-          expect(current_path).to eq users_almost_there_path
+          expect(page).to have_current_path users_almost_there_path, ignore_query: true
           expect(page).to have_content("Please check your email (#{new_user.email}) to confirm your account")
 
           confirm_email
@@ -223,7 +223,7 @@ RSpec.describe 'Signup' do
           fill_in_signup_form
 
           expect { click_button 'Register' }.to change { User.count }.by(1)
-          expect(current_path).to eq users_sign_up_welcome_path
+          expect(page).to have_current_path users_sign_up_welcome_path, ignore_query: true
         end
       end
     end
@@ -239,7 +239,7 @@ RSpec.describe 'Signup' do
         fill_in_signup_form
         click_button "Register"
 
-        expect(current_path).to eq users_sign_up_welcome_path
+        expect(page).to have_current_path users_sign_up_welcome_path, ignore_query: true
       end
     end
 
@@ -254,7 +254,7 @@ RSpec.describe 'Signup' do
         fill_in_signup_form
 
         expect { click_button 'Register' }.to change { User.count }.by(1)
-        expect(current_path).to eq new_user_session_path
+        expect(page).to have_current_path new_user_session_path, ignore_query: true
         expect(page).to have_content("You have signed up successfully. However, we could not sign you in because your account is awaiting approval from your GitLab administrator")
       end
     end
@@ -268,7 +268,7 @@ RSpec.describe 'Signup' do
       fill_in_signup_form
       click_button "Register"
 
-      expect(current_path).to eq user_registration_path
+      expect(page).to have_current_path user_registration_path, ignore_query: true
       expect(page).to have_content("error prohibited this user from being saved")
       expect(page).to have_content("Email has already been taken")
     end
@@ -280,7 +280,7 @@ RSpec.describe 'Signup' do
       fill_in_signup_form
       click_button "Register"
 
-      expect(current_path).to eq user_registration_path
+      expect(page).to have_current_path user_registration_path, ignore_query: true
       expect(page.body).not_to match(/#{new_user.password}/)
     end
   end
@@ -298,7 +298,7 @@ RSpec.describe 'Signup' do
       fill_in_signup_form
       click_button 'Register'
 
-      expect(current_path).to eq users_sign_up_welcome_path
+      expect(page).to have_current_path users_sign_up_welcome_path, ignore_query: true
     end
   end
 
diff --git a/spec/features/users/terms_spec.rb b/spec/features/users/terms_spec.rb
index 7cfe74f8aa9..5fde445a775 100644
--- a/spec/features/users/terms_spec.rb
+++ b/spec/features/users/terms_spec.rb
@@ -82,7 +82,7 @@ RSpec.describe 'Users > Terms', :js do
 
         click_link 'Continue'
 
-        expect(current_path).to eq(root_path)
+        expect(page).to have_current_path(root_path, ignore_query: true)
       end
     end
 
@@ -108,7 +108,7 @@ RSpec.describe 'Users > Terms', :js do
 
           click_button('Accept terms')
 
-          expect(current_path).to eq(project_issues_path(project))
+          expect(page).to have_current_path(project_issues_path(project), ignore_query: true)
         end
       end
 
@@ -123,11 +123,11 @@ RSpec.describe 'Users > Terms', :js do
 
         click_button 'Create issue'
 
-        expect(current_path).to eq(terms_path)
+        expect(page).to have_current_path(terms_path, ignore_query: true)
 
         click_button('Accept terms')
 
-        expect(current_path).to eq(new_project_issue_path(project))
+        expect(page).to have_current_path(new_project_issue_path(project), ignore_query: true)
         expect(find_field('issue_title').value).to eq('Hello world, a new issue')
         expect(find_field('issue_description').value).to eq("We don't want to lose what the user typed")
       end
diff --git a/spec/fixtures/emails/service_desk_reply_to_and_from.eml b/spec/fixtures/emails/service_desk_reply_to_and_from.eml
new file mode 100644
index 00000000000..2545e0d30f8
--- /dev/null
+++ b/spec/fixtures/emails/service_desk_reply_to_and_from.eml
@@ -0,0 +1,28 @@
+Delivered-To: incoming+email-test-project_id-issue-@appmail.adventuretime.ooo
+Return-Path: 
+Received: from iceking.adventuretime.ooo ([unix socket]) by iceking (Cyrus v2.2.13-Debian-2.2.13-19+squeeze3) with LMTPA; Thu, 13 Jun 2013 17:03:50 -0400
+Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) by iceking.adventuretime.ooo (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5DL3nFJ016967 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 13 Jun 2013 17:03:50 -0400
+Received: by mail-ie0-f180.google.com with SMTP id f4so21977375iea.25 for ; Thu, 13 Jun 2013 14:03:48 -0700
+Received: by 10.0.0.1 with HTTP; Thu, 13 Jun 2013 14:03:48 -0700
+Date: Thu, 13 Jun 2013 17:03:48 -0400
+Reply-To: Marceline 
+From: Finn the Human 
+Sender: Jake the Dog 
+To: support@adventuretime.ooo
+Delivered-To: support@adventuretime.ooo
+Message-ID: 
+Subject: The message subject! @all
+Mime-Version: 1.0
+Content-Type: text/plain;
+ charset=ISO-8859-1
+Content-Transfer-Encoding: 7bit
+X-Sieve: CMU Sieve 2.2
+X-Received: by 10.0.0.1 with SMTP id n7mr11234144ipb.85.1371157428600; Thu,
+ 13 Jun 2013 14:03:48 -0700 (PDT)
+X-Scanned-By: MIMEDefang 2.69 on IPv6:2001:470:1d:165::1
+
+Service desk stuff!
+
+```
+a = b
+```
diff --git a/spec/lib/gitlab/ci/parsers/security/common_spec.rb b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
index 78c357eb14a..1e96c717a4f 100644
--- a/spec/lib/gitlab/ci/parsers/security/common_spec.rb
+++ b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
@@ -60,7 +60,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
             it 'instantiates the validator with correct params' do
               parse_report
 
-              expect(validator_class).to have_received(:new).with(report.type, {})
+              expect(validator_class).to have_received(:new).with(report.type, {}, report.version)
             end
 
             context 'when the report data is not valid according to the schema' do
@@ -110,7 +110,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
             it 'instantiates the validator with correct params' do
               parse_report
 
-              expect(validator_class).to have_received(:new).with(report.type, {})
+              expect(validator_class).to have_received(:new).with(report.type, {}, report.version)
             end
 
             context 'when the report data is not valid according to the schema' do
@@ -175,7 +175,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
             it 'instantiates the validator with correct params' do
               parse_report
 
-              expect(validator_class).to have_received(:new).with(report.type, {})
+              expect(validator_class).to have_received(:new).with(report.type, {}, report.version)
             end
 
             context 'when the report data is not valid according to the schema' do
diff --git a/spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb b/spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb
index 070b65c7808..c83427b68ef 100644
--- a/spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb
+++ b/spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb
@@ -49,14 +49,14 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Validators::SchemaValidator do
 
   using RSpec::Parameterized::TableSyntax
 
-  where(:report_type, :expected_errors, :valid_data) do
-    'sast' | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
-    :sast  | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
-    :secret_detection | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
+  where(:report_type, :report_version, :expected_errors, :valid_data) do
+    'sast' | '10.0.0' | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
+    :sast  | '10.0.0' | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
+    :secret_detection | '10.0.0' | ['root is missing required keys: vulnerabilities'] | { 'version' => '10.0.0', 'vulnerabilities' => [] }
   end
 
   with_them do
-    let(:validator) { described_class.new(report_type, report_data) }
+    let(:validator) { described_class.new(report_type, report_data, report_version) }
 
     describe '#valid?' do
       subject { validator.valid? }
@@ -72,6 +72,15 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Validators::SchemaValidator do
 
         it { is_expected.to be_truthy }
       end
+
+      context 'when no report_version is provided' do
+        let(:report_version) { nil }
+        let(:report_data) { valid_data }
+
+        it 'does not fail' do
+          expect { subject }.not_to raise_error
+        end
+      end
     end
 
     describe '#errors' do
diff --git a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
index 8d008986464..913e197708f 100644
--- a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
+++ b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
@@ -477,6 +477,20 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do
       end
     end
 
+    context 'when there is a reply-to address and a from address' do
+      let(:email_raw) { email_fixture('emails/service_desk_reply_to_and_from.eml') }
+
+      it 'shows both from and reply-to addresses in the issue header' do
+        setup_attachment
+
+        expect { receiver.execute }.to change { Issue.count }.by(1)
+
+        new_issue = Issue.last
+
+        expect(new_issue.external_author).to eq('finn@adventuretime.ooo (reply to: marceline@adventuretime.ooo)')
+      end
+    end
+
     context 'when service desk is not enabled for project' do
       before do
         allow(Gitlab::ServiceDesk).to receive(:enabled?).and_return(false)
diff --git a/spec/lib/gitlab/import_export/project/relation_factory_spec.rb b/spec/lib/gitlab/import_export/project/relation_factory_spec.rb
index ffbbf9326ec..240d86077c4 100644
--- a/spec/lib/gitlab/import_export/project/relation_factory_spec.rb
+++ b/spec/lib/gitlab/import_export/project/relation_factory_spec.rb
@@ -401,4 +401,20 @@ RSpec.describe Gitlab::ImportExport::Project::RelationFactory, :use_clean_rails_
       expect(created_object.value).to be_nil
     end
   end
+
+  context 'event object' do
+    let(:relation_sym) { :events }
+    let(:relation_hash) do
+      {
+        'project_id' => project.id,
+        'author_id' => admin.id,
+        'action' => 'created',
+        'target_type' => 'Issue'
+      }
+    end
+
+    it 'has preloaded project' do
+      expect(created_object.project).to equal(project)
+    end
+  end
 end
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb
index 8e842e4797e..7a77acf4767 100644
--- a/spec/services/projects/destroy_service_spec.rb
+++ b/spec/services/projects/destroy_service_spec.rb
@@ -437,11 +437,12 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
       destroy_project(project, user)
     end
 
-    it 'calls the bulk snippet destroy service' do
+    it 'calls the bulk snippet destroy service with the hard_delete param set to true' do
       expect(project.snippets.count).to eq 2
 
-      expect(Snippets::BulkDestroyService).to receive(:new)
-        .with(user, project.snippets).and_call_original
+      expect_next_instance_of(Snippets::BulkDestroyService, user, project.snippets) do |instance|
+        expect(instance).to receive(:execute).with(hard_delete: true).and_call_original
+      end
 
       expect do
         destroy_project(project, user)
diff --git a/spec/support/helpers/terms_helper.rb b/spec/support/helpers/terms_helper.rb
index a61bae18f9a..b71307a4d6d 100644
--- a/spec/support/helpers/terms_helper.rb
+++ b/spec/support/helpers/terms_helper.rb
@@ -15,7 +15,7 @@ module TermsHelper
   end
 
   def expect_to_be_on_terms_page
-    expect(current_path).to eq terms_path
+    expect(page).to have_current_path terms_path, ignore_query: true
     expect(page).to have_content('Please accept the Terms of Service before continuing.')
   end
 end
diff --git a/spec/support/shared_examples/features/integrations/user_activates_mattermost_slash_command_integration_shared_examples.rb b/spec/support/shared_examples/features/integrations/user_activates_mattermost_slash_command_integration_shared_examples.rb
index cfa043322db..4c312b42c0a 100644
--- a/spec/support/shared_examples/features/integrations/user_activates_mattermost_slash_command_integration_shared_examples.rb
+++ b/spec/support/shared_examples/features/integrations/user_activates_mattermost_slash_command_integration_shared_examples.rb
@@ -18,7 +18,7 @@ RSpec.shared_examples 'user activates the Mattermost Slash Command integration'
     click_active_checkbox
     click_save_integration
 
-    expect(current_path).to eq(edit_path)
+    expect(page).to have_current_path(edit_path, ignore_query: true)
     expect(page).to have_content('Mattermost slash commands settings saved, but not active.')
   end
 
@@ -28,7 +28,7 @@ RSpec.shared_examples 'user activates the Mattermost Slash Command integration'
     fill_in 'service_token', with: token
     click_save_integration
 
-    expect(current_path).to eq(edit_path)
+    expect(page).to have_current_path(edit_path, ignore_query: true)
     expect(page).to have_content('Mattermost slash commands settings saved and active.')
   end
 end
diff --git a/spec/support/shared_examples/features/project_upload_files_shared_examples.rb b/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
index 85434ba7afd..066c3e17a09 100644
--- a/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
+++ b/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
@@ -24,7 +24,7 @@ RSpec.shared_examples 'it uploads and commits a new text file' do |drop: false|
     click_button('Upload file')
 
     expect(page).to have_content('New commit message')
-    expect(current_path).to eq(project_new_merge_request_path(project))
+    expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true)
 
     click_link('Changes')
     find("a[data-action='diffs']", text: 'Changes').click
@@ -129,7 +129,7 @@ RSpec.shared_examples 'it uploads and commits a new file to a forked project' do
 
     fork = user.fork_of(project2.reload)
 
-    expect(current_path).to eq(project_new_merge_request_path(fork))
+    expect(page).to have_current_path(project_new_merge_request_path(fork), ignore_query: true)
 
     find("a[data-action='diffs']", text: 'Changes').click
 
diff --git a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb
index dfc9a45bd0d..f676b6aa60d 100644
--- a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb
+++ b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb
@@ -50,7 +50,7 @@ RSpec.shared_examples 'User creates wiki page' do
         click_on("Create page")
       end
 
-      expect(current_path).to include("one/two/three-test")
+      expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true)
       expect(page).to have_link(href: wiki_page_path(wiki, 'one/two/three-test'))
     end
 
@@ -68,7 +68,7 @@ RSpec.shared_examples 'User creates wiki page' do
         click_button("Create page")
       end
 
-      expect(current_path).to eq(wiki_page_path(wiki, "home"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "home"), ignore_query: true)
       expect(page).to have_content("test GitLab API doc Rake tasks Wiki header")
                   .and have_content("Home")
                   .and have_content("Last edited by #{user.name}")
@@ -76,7 +76,7 @@ RSpec.shared_examples 'User creates wiki page' do
 
       click_link("test")
 
-      expect(current_path).to eq(wiki_page_path(wiki, "test"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "test"), ignore_query: true)
 
       page.within(:css, ".wiki-page-header") do
         expect(page).to have_content("Create New Page")
@@ -84,11 +84,11 @@ RSpec.shared_examples 'User creates wiki page' do
 
       click_link("Home")
 
-      expect(current_path).to eq(wiki_page_path(wiki, "home"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "home"), ignore_query: true)
 
       click_link("GitLab API")
 
-      expect(current_path).to eq(wiki_page_path(wiki, "api"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "api"), ignore_query: true)
 
       page.within(:css, ".wiki-page-header") do
         expect(page).to have_content("Create")
@@ -96,11 +96,11 @@ RSpec.shared_examples 'User creates wiki page' do
 
       click_link("Home")
 
-      expect(current_path).to eq(wiki_page_path(wiki, "home"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "home"), ignore_query: true)
 
       click_link("Rake tasks")
 
-      expect(current_path).to eq(wiki_page_path(wiki, "raketasks"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "raketasks"), ignore_query: true)
 
       page.within(:css, ".wiki-page-header") do
         expect(page).to have_content("Create")
diff --git a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb
index a456b76b324..85490bffc0e 100644
--- a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb
+++ b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb
@@ -25,7 +25,7 @@ RSpec.shared_examples 'User updates wiki page' do
         click_on('Cancel')
       end
 
-      expect(current_path).to eq wiki_path(wiki)
+      expect(page).to have_current_path wiki_path(wiki), ignore_query: true
     end
 
     it 'updates a page that has a path', :js do
@@ -36,7 +36,7 @@ RSpec.shared_examples 'User updates wiki page' do
         click_on('Create page')
       end
 
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true)
       expect(find('.wiki-pages')).to have_content('three')
 
       first(:link, text: 'three').click
@@ -45,7 +45,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_on('Edit')
 
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true)
       expect(page).to have_content('Edit Page')
 
       fill_in('Content', with: 'Updated Wiki Content')
@@ -120,7 +120,7 @@ RSpec.shared_examples 'User updates wiki page' do
         click_on('Cancel')
       end
 
-      expect(current_path).to eq(wiki_page_path(wiki, wiki_page))
+      expect(page).to have_current_path(wiki_page_path(wiki, wiki_page), ignore_query: true)
     end
 
     it_behaves_like 'wiki file attachments'
@@ -175,7 +175,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(wiki_page_path(wiki, page_name))
+      expect(page).to have_current_path(wiki_page_path(wiki, page_name), ignore_query: true)
     end
 
     it 'moves the page to other dir', :js do
@@ -185,7 +185,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(wiki_page_path(wiki, new_page_dir))
+      expect(page).to have_current_path(wiki_page_path(wiki, new_page_dir), ignore_query: true)
     end
 
     it 'remains in the same place if title has not changed', :js do
@@ -195,7 +195,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(original_path)
+      expect(page).to have_current_path(original_path, ignore_query: true)
     end
 
     it 'can be moved to a different dir with a different name', :js do
@@ -205,7 +205,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(wiki_page_path(wiki, new_page_dir))
+      expect(page).to have_current_path(wiki_page_path(wiki, new_page_dir), ignore_query: true)
     end
 
     it 'can be renamed and moved to the root folder', :js do
@@ -215,7 +215,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(wiki_page_path(wiki, new_name))
+      expect(page).to have_current_path(wiki_page_path(wiki, new_name), ignore_query: true)
     end
 
     it 'squishes the title before creating the page', :js do
@@ -225,7 +225,7 @@ RSpec.shared_examples 'User updates wiki page' do
 
       click_button('Save changes')
 
-      expect(current_path).to eq(wiki_page_path(wiki, "foo1/bar1/#{page_name}"))
+      expect(page).to have_current_path(wiki_page_path(wiki, "foo1/bar1/#{page_name}"), ignore_query: true)
     end
 
     it_behaves_like 'wiki file attachments'
diff --git a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb
index 39a42fa2d5c..a7c32932ba7 100644
--- a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb
+++ b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb
@@ -37,12 +37,12 @@ RSpec.shared_examples 'User views a wiki page' do
     end
 
     it 'shows the history of a page that has a path' do
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test))
 
       first(:link, text: 'three').click
       click_on('Page history')
 
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test))
 
       page.within(:css, '.wiki-page-header') do
         expect(page).to have_content('History')
@@ -50,7 +50,7 @@ RSpec.shared_examples 'User views a wiki page' do
     end
 
     it 'shows an old version of a page', :js do
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test))
       expect(find('.wiki-pages')).to have_content('three')
 
       first(:link, text: 'three').click
@@ -59,7 +59,7 @@ RSpec.shared_examples 'User views a wiki page' do
 
       click_on('Edit')
 
-      expect(current_path).to include('one/two/three-test')
+      expect(page).to have_current_path(%r(one/two/three-test))
       expect(page).to have_content('Edit Page')
 
       fill_in('Content', with: 'Updated Wiki Content')
@@ -98,7 +98,7 @@ RSpec.shared_examples 'User views a wiki page' do
 
         click_on('image')
 
-        expect(current_path).to match("wikis/#{path}")
+        expect(page).to have_current_path(%r(wikis/#{path}))
       end
     end
 
@@ -107,7 +107,7 @@ RSpec.shared_examples 'User views a wiki page' do
 
       click_on('image')
 
-      expect(current_path).to match("wikis/#{path}")
+      expect(page).to have_current_path(%r(wikis/#{path}))
       expect(page).to have_content('Create New Page')
     end
   end