diff options
Diffstat (limited to 'spec/features/projects')
29 files changed, 75 insertions, 75 deletions
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') |