From fe13f110412d85c05dc68e5ee1db499f681bf722 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 29 Jun 2017 12:06:35 -0500 Subject: Create and use project path helpers that only need a project, no namespace --- features/steps/project/archived.rb | 2 +- features/steps/project/badges/build.rb | 2 +- features/steps/project/commits/commits.rb | 8 +-- features/steps/project/commits/revert.rb | 2 +- features/steps/project/commits/user_lookup.rb | 4 +- features/steps/project/create.rb | 4 +- features/steps/project/deploy_keys.rb | 2 +- features/steps/project/fork.rb | 2 +- features/steps/project/forked_merge_requests.rb | 6 +- features/steps/project/graph.rb | 10 +-- features/steps/project/issues/award_emoji.rb | 2 +- features/steps/project/issues/issues.rb | 6 +- features/steps/project/issues/labels.rb | 2 +- features/steps/project/merge_requests.rb | 2 +- .../steps/project/merge_requests/acceptance.rb | 1 - features/steps/project/merge_requests/revert.rb | 1 - features/steps/project/network_graph.rb | 4 +- features/steps/project/pages.rb | 4 +- features/steps/project/project_group_links.rb | 2 +- features/steps/project/redirects.rb | 6 +- features/steps/project/services.rb | 2 +- features/steps/project/snippets.rb | 2 +- features/steps/project/source/browse_files.rb | 28 ++++----- features/steps/project/source/markdown_render.rb | 72 +++++++++++----------- features/steps/project/wiki.rb | 8 +-- 25 files changed, 91 insertions(+), 93 deletions(-) (limited to 'features/steps/project') diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb index b6f1d417e21..e4847180be9 100644 --- a/features/steps/project/archived.rb +++ b/features/steps/project/archived.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps When 'I visit project "Forum" page' do project = Project.find_by(name: "Forum") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I should not see "Archived"' do diff --git a/features/steps/project/badges/build.rb b/features/steps/project/badges/build.rb index 96c59322f9b..5a9094ee9d3 100644 --- a/features/steps/project/badges/build.rb +++ b/features/steps/project/badges/build.rb @@ -5,7 +5,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps include RepoHelpers step 'I display builds badge for a master branch' do - visit build_namespace_project_badges_path(@project.namespace, @project, ref: :master, format: :svg) + visit build_project_badges_path(@project, ref: :master, format: :svg) end step 'I should see a build success badge' do diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index f19fa1c7600..305fff37c41 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -33,7 +33,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I see commit info' do @@ -73,7 +73,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I visit commits list page for feature branch' do - visit namespace_project_commits_path(@project.namespace, @project, 'feature', { limit: 5 }) + visit project_commits_path(@project, 'feature', { limit: 5 }) end step 'I see feature branch commits' do @@ -119,7 +119,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I should see button to the merge request' do merge_request = MergeRequest.find_by(title: 'Feature') - expect(page).to have_link "View open merge request", href: namespace_project_merge_request_path(@project.namespace, @project, merge_request) + expect(page).to have_link "View open merge request", href: project_merge_request_path(@project, merge_request) end step 'I see breadcrumb links' do @@ -135,7 +135,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I visit a commit with an image that changed' do - visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) + visit project_commit_path(@project, sample_image_commit.id) end step 'The diff links to both the previous and current image' do diff --git a/features/steps/project/commits/revert.rb b/features/steps/project/commits/revert.rb index 114de129d19..ebfa7a878bb 100644 --- a/features/steps/project/commits/revert.rb +++ b/features/steps/project/commits/revert.rb @@ -6,7 +6,7 @@ class Spinach::Features::RevertCommits < Spinach::FeatureSteps include RepoHelpers step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I click on the revert button' do diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb index 2d43be5a386..4599e0d032a 100644 --- a/features/steps/project/commits/user_lookup.rb +++ b/features/steps/project/commits/user_lookup.rb @@ -4,11 +4,11 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps include SharedPaths step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I click on another commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.parent_id) + visit project_commit_path(@project, sample_commit.parent_id) end step 'I have user with primary email' do diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 28be9c6df5b..60fa232672e 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -7,12 +7,12 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps fill_in 'project_path', with: 'Empty' page.within '#content-body' do click_button "Create project" - end + end end step 'I should see project page' do expect(page).to have_content "Empty" - expect(current_path).to eq namespace_project_path(Project.last.namespace, Project.last) + expect(current_path).to eq project_path(Project.last) end step 'I should see empty project instructions' do diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 8ad9d4a4741..b58d595c7c6 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -36,7 +36,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should be on deploy keys page' do - expect(current_path).to eq namespace_project_settings_repository_path(@project.namespace, @project) + expect(current_path).to eq project_settings_repository_path(@project) end step 'I should see newly created deploy key' do diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 35df403a85f..dd4dff7f7a9 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -53,7 +53,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps step 'I visit the forks page of the "Shop" project' do @project = Project.where(name: 'Shop').last - visit namespace_project_forks_path(@project.namespace, @project) + visit project_forks_path(@project) end step 'I should see my fork on the list' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 2d9d3efd9d4..c6cabace25b 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -25,7 +25,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I should see merge request "Merge Request On Forked Project"' do expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq project_merge_request_path(@project, @merge_request) expect(@merge_request.title).to eq "Merge Request On Forked Project" expect(@merge_request.source_project).to eq @forked_project expect(@merge_request.source_branch).to eq "fix" @@ -77,7 +77,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps expect(page).to have_content "An Edited Forked Merge Request" expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq project_merge_request_path(@project, @merge_request) expect(@merge_request.source_project).to eq @forked_project expect(@merge_request.source_branch).to eq "fix" expect(@merge_request.target_branch).to eq "master" @@ -97,7 +97,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - expect(current_path).to eq edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq edit_project_merge_request_path(@project, @merge_request) expect(page).to have_content "Edit merge request #{@merge_request.to_reference}" expect(find("#merge_request_title").value).to eq "Merge Request On Forked Project" end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb index 176d04d721c..e78e25318a6 100644 --- a/features/steps/project/graph.rb +++ b/features/steps/project/graph.rb @@ -7,19 +7,19 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps end When 'I visit project "Shop" graph page' do - visit namespace_project_graph_path(project.namespace, project, "master") + visit project_graph_path(project, "master") end step 'I visit project "Shop" commits graph page' do - visit commits_namespace_project_graph_path(project.namespace, project, "master") + visit commits_project_graph_path(project, "master") end step 'I visit project "Shop" languages graph page' do - visit languages_namespace_project_graph_path(project.namespace, project, "master") + visit languages_project_graph_path(project, "master") end step 'I visit project "Shop" chart page' do - visit charts_namespace_project_graph_path(project.namespace, project, "master") + visit charts_project_graph_path(project, "master") end step 'page should have languages graphs' do @@ -33,7 +33,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps end step 'I visit project "Shop" CI graph page' do - visit ci_namespace_project_graph_path(project.namespace, project, 'master') + visit ci_project_graph_path(project, 'master') end step 'page should have CI graphs' do diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb index 2324edda975..bbd284b4633 100644 --- a/features/steps/project/issues/award_emoji.rb +++ b/features/steps/project/issues/award_emoji.rb @@ -5,7 +5,7 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps include Select2Helper step 'I visit "Bugfix" issue page' do - visit namespace_project_issue_path(@project.namespace, @project, @issue) + visit project_issue_path(@project, @issue) end step 'I click the thumbsup award Emoji' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index e4a559d8ff5..2deef9036d3 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -247,7 +247,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When 'I visit empty project page' do project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I see empty project details with ssh clone info' do @@ -259,12 +259,12 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When "I visit project \"Community\" issues page" do project = Project.find_by(name: 'Community') - visit namespace_project_issues_path(project.namespace, project) + visit project_issues_path(project) end When "I visit empty project's issues page" do project = Project.find_by(name: 'Empty Project') - visit namespace_project_issues_path(project.namespace, project) + visit project_issues_path(project) end step 'I leave a comment with code block' do diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 2828e41f731..dac18c537ac 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps include SharedPaths step 'I visit \'bug\' label edit page' do - visit edit_namespace_project_label_path(project.namespace, project, bug_label) + visit edit_project_label_path(project, bug_label) end step 'I remove label \'bug\'' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index dceeed5aafe..810cd75591b 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -256,7 +256,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I switch to the merge request\'s comments tab' do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end step 'I click on the commit in the merge request' do diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb index 870dc862992..3c640e3512a 100644 --- a/features/steps/project/merge_requests/acceptance.rb +++ b/features/steps/project/merge_requests/acceptance.rb @@ -1,6 +1,5 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps include LoginHelpers - include GitlabRoutingHelper include WaitForRequests step 'I am on the Merge Request detail page' do diff --git a/features/steps/project/merge_requests/revert.rb b/features/steps/project/merge_requests/revert.rb index 98d990f112f..25ccf5ab180 100644 --- a/features/steps/project/merge_requests/revert.rb +++ b/features/steps/project/merge_requests/revert.rb @@ -1,6 +1,5 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps include LoginHelpers - include GitlabRoutingHelper include WaitForRequests step 'I click on the revert button' do diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb index 370e46265c7..ba98d861e7b 100644 --- a/features/steps/project/network_graph.rb +++ b/features/steps/project/network_graph.rb @@ -12,11 +12,11 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps Network::Graph.stub(max_count: 10) @project = Project.find_by(name: "Shop") - visit namespace_project_network_path(@project.namespace, @project, "master") + visit project_network_path(@project, "master") end step "I visit project network page on branch 'test'" do - visit namespace_project_network_path(@project.namespace, @project, "'test'") + visit project_network_path(@project, "'test'") end step 'page should select "master" in select box' do diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb index 4e6830f738b..275fb4fc010 100644 --- a/features/steps/project/pages.rb +++ b/features/steps/project/pages.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'I visit the Project Pages' do - visit namespace_project_pages_path(@project.namespace, @project) + visit project_pages_path(@project) end step 'I should see the usage of GitLab Pages' do @@ -75,7 +75,7 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'I visit add a new Pages Domain' do - visit new_namespace_project_pages_domain_path(@project.namespace, @project) + visit new_project_pages_domain_path(@project) end step 'I fill the domain' do diff --git a/features/steps/project/project_group_links.rb b/features/steps/project/project_group_links.rb index 5280a38ce81..47ee31786a6 100644 --- a/features/steps/project/project_group_links.rb +++ b/features/steps/project/project_group_links.rb @@ -42,7 +42,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps end step 'I visit project group links page' do - visit namespace_project_group_links_path(project.namespace, project) + visit project_group_links_path(project) end def project diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 92936f27c20..b2ceb8dd9a8 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -13,7 +13,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Community" page' do project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I should see project "Community" home page' do @@ -25,12 +25,12 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Enterprise" page' do project = Project.find_by(name: 'Enterprise') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "CommunityDoesNotExist" page' do project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + 'DoesNotExist' + visit project_path(project) + 'DoesNotExist' end step 'I click on "Sign In"' do diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 6bac4df16f8..906a81b29b3 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps include SharedPaths step 'I visit project "Shop" services page' do - visit namespace_project_settings_integrations_path(@project.namespace, @project) + visit project_settings_integrations_path(@project) end step 'I should see list of available services' do diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index dd49701a3d9..b0407d3f07d 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -91,7 +91,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I visit snippet page "Snippet one"' do - visit namespace_project_snippet_path(project.namespace, project, project_snippet) + visit project_snippet_path(project, project_snippet) end def project_snippet diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 02434319a08..5475b32388c 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -9,7 +9,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step "I don't have write access" do @project = create(:project, :repository, name: "Other Project", path: "other-project") @project.team << [@user, :reporter] - visit namespace_project_tree_path(@project.namespace, @project, root_ref) + visit project_tree_path(@project, root_ref) end step 'I should see files from repository' do @@ -19,7 +19,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see files from repository for "6d39438"' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "6d39438") + expect(current_path).to eq project_tree_path(@project, "6d39438") expect(page).to have_content ".gitignore" expect(page).to have_content "LICENSE" end @@ -240,16 +240,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, 'master') + expect(current_path).to eq project_tree_path(@project, 'master') end step 'I am redirected to the ".gitignore"' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) + expect(current_path).to eq(project_blob_path(@project, 'master/.gitignore')) end step 'I am redirected to the permalink URL' do expect(current_path).to( - eq(namespace_project_blob_path(@project.namespace, @project, + eq(project_blob_path(@project, @project.repository.commit.sha + '/.gitignore')) ) @@ -257,26 +257,26 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I am redirected to the new file' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name)) + project_blob_path(@project, 'master/' + new_file_name)) end step 'I am redirected to the new file with directory' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name_with_directory)) + project_blob_path(@project, 'master/' + new_file_name_with_directory)) end step 'I am redirected to the new merge request page' do - expect(current_path).to eq(namespace_project_new_merge_request_path(@project.namespace, @project)) + expect(current_path).to eq(project_new_merge_request_path(@project)) end step "I am redirected to the fork's new merge request page" do fork = @user.fork_of(@project) - expect(current_path).to eq(namespace_project_new_merge_request_path(fork.namespace, fork)) + expect(current_path).to eq(project_new_merge_request_path(fork)) end step 'I am redirected to the root directory' do expect(current_path).to eq( - namespace_project_tree_path(@project.namespace, @project, 'master')) + project_tree_path(@project, 'master')) end step "I don't see the permalink link" do @@ -327,11 +327,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step "I visit the 'test' tree" do - visit namespace_project_tree_path(@project.namespace, @project, "'test'") + visit project_tree_path(@project, "'test'") end step "I visit the fix tree" do - visit namespace_project_tree_path(@project.namespace, @project, "fix/.testdir") + visit project_tree_path(@project, "fix/.testdir") end step 'I see the commit data' do @@ -346,7 +346,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I click on "files/lfs/lfs_object.iso" file in repo' do allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(true) - visit namespace_project_tree_path(@project.namespace, @project, "lfs") + visit project_tree_path(@project, "lfs") click_link 'files' click_link "lfs" click_link "lfs_object.iso" @@ -389,7 +389,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I visit the SVG file' do - visit namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/logo_sample.svg') + visit project_blob_path(@project, 'new_branch_name/logo_sample.svg') end step 'I can see the new rendered SVG image' do diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index cf31e61437e..243a0f54f7f 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -14,7 +14,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(current_path).to eq project_tree_path(@project, "markdown") expect(page).to have_content "README.md" expect(page).to have_content "CHANGELOG" end @@ -34,7 +34,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "All API requests require authentication" end @@ -44,7 +44,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct directory rendered' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") expect(page).to have_content "backup_restore.md" expect(page).to have_content "maintenance.md" end @@ -54,7 +54,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct doc/api directory rendered' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") expect(page).to have_content "README.md" expect(page).to have_content "users.md" end @@ -64,7 +64,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct maintenance file rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/raketasks/maintenance.md") wait_for_requests expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" end @@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see correct file rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "Contents" expect(page).to have_link "Users" @@ -110,7 +110,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct document file' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") expect(page).to have_content "Get a list of users." end @@ -121,30 +121,30 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps # Markdown branch When 'I visit markdown branch' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown") + visit project_tree_path(@project, "markdown") wait_for_requests end When 'I visit markdown branch "README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + visit project_blob_path(@project, "markdown/README.md") end When 'I visit markdown branch "d" tree' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/d") + visit project_tree_path(@project, "markdown/d") end When 'I visit markdown branch "d/README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") + visit project_blob_path(@project, "markdown/d/README.md") end step 'I should see files from repository in markdown branch' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(current_path).to eq project_tree_path(@project, "markdown") expect(page).to have_content "README.md" expect(page).to have_content "CHANGELOG" end step 'I see correct file rendered in markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "Contents" expect(page).to have_link "Users" @@ -152,19 +152,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered for markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "All API requests require authentication" end step 'I should see correct directory rendered for markdown branch' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") expect(page).to have_content "backup_restore.md" expect(page).to have_content "maintenance.md" end step 'I should see the users document file in markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") expect(page).to have_content "Get a list of users." end @@ -172,54 +172,54 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'The link with text "empty" should have url "tree/markdown"' do wait_for_requests - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown") end step 'The link with text "empty" should have url "blob/markdown/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") end step 'The link with text "empty" should have url "tree/markdown/d"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown/d") + find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d") end step 'The link with text "empty" should have '\ 'url "blob/markdown/d/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") + find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md") end step 'The link with text "ID" should have url "tree/markdownID"' do - find('a', text: /^#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' + find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' end step 'The link with text "/ID" should have url "tree/markdownID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' end step 'The link with text "README.mdID" '\ 'should have url "blob/markdown/README.mdID"' do - find('a', text: /^README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end step 'The link with text "d/README.mdID" should have '\ 'url "blob/markdown/d/README.mdID"' do - find('a', text: /^d\/README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "d/markdown/README.md") + '#id' + find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id' end step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do wait_for_requests - find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end # Wiki step 'I go to wiki page' do click_link "Wiki" - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") end step 'I add various links to the wiki page' do @@ -231,7 +231,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'Wiki page should have added links' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") expect(page).to have_content "test GitLab API doc Rake tasks" end @@ -252,7 +252,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see new wiki page named test' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test") + expect(current_path).to eq project_wiki_path(@project, "test") page.within(:css, ".nav-text") do expect(page).to have_content "Test" @@ -261,8 +261,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end When 'I go back to wiki page home' do - visit namespace_project_wiki_path(@project.namespace, @project, "home") - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + visit project_wiki_path(@project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") end step 'I click on GitLab API doc link' do @@ -270,7 +270,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Gitlab API document' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api") + expect(current_path).to eq project_wiki_path(@project, "api") page.within(:css, ".nav-text") do expect(page).to have_content "Create" @@ -283,7 +283,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Rake tasks directory' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks") + expect(current_path).to eq project_wiki_path(@project, "raketasks") page.within(:css, ".nav-text") do expect(page).to have_content "Create" @@ -292,8 +292,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I go directory which contains README file' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + visit project_tree_path(@project, "markdown/doc/api") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") end step 'I click on a relative link in README' do @@ -301,7 +301,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct markdown' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") wait_for_requests expect(page).to have_content "List users" end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index 517c257d892..a2f5d2e1515 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to the Edit Home Wiki page' do - expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, :home) + expect(current_path).to eq project_wiki_path(project, :home) end step 'I create the Wiki Home page' do @@ -42,7 +42,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to that Wiki page' do - visit namespace_project_wiki_path(project.namespace, project, @page) + visit project_wiki_path(project, @page) end step 'I click on the Edit button' do @@ -59,7 +59,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to that Wiki page' do - expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, @page) + expect(current_path).to eq project_wiki_path(project, @page) end step 'That page has two revisions' do @@ -95,7 +95,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to wiki page with images' do - visit namespace_project_wiki_path(project.namespace, project, @wiki_page) + visit project_wiki_path(project, @wiki_page) end step 'I click on existing image link' do -- cgit v1.2.1