Commit 9eeba8fb authored by Robert Speicher's avatar Robert Speicher

Auto-correct ProjectPathHelper violations

parent ea2a91a3
......@@ -51,7 +51,7 @@ feature 'Admin disables Git access protocol', feature: true do
end
def visit_project
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
def disable_http_protocol
......
......@@ -44,7 +44,7 @@ describe "Admin::Projects", feature: true do
end
it do
expect(current_path).to eq admin_namespace_project_path(project.namespace, project)
expect(current_path).to eq admin_project_path(project)
end
it "has project info" do
......@@ -64,7 +64,7 @@ describe "Admin::Projects", feature: true do
end
it 'transfers project to group web', js: true do
visit admin_namespace_project_path(project.namespace, project)
visit admin_project_path(project)
click_button 'Search for Namespace'
click_link 'group: web'
......@@ -81,7 +81,7 @@ describe "Admin::Projects", feature: true do
end
it 'adds admin a to a project as developer', js: true do
visit namespace_project_project_members_path(project.namespace, project)
visit project_project_members_path(project)
page.within '.users-project-form' do
select2(current_user.id, from: '#user_ids', multiple: true)
......@@ -104,7 +104,7 @@ describe "Admin::Projects", feature: true do
end
it 'removes admin from the project' do
visit namespace_project_project_members_path(project.namespace, project)
visit project_project_members_path(project)
page.within '.content-list' do
expect(page).to have_content(current_user.name)
......
......@@ -43,6 +43,6 @@ feature 'Admin uses repository checks', feature: true do
end
def visit_admin_project_page(project)
visit admin_namespace_project_path(project.namespace, project)
visit admin_project_path(project)
end
end
......@@ -16,7 +16,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated' do
it 'renders atom feed' do
sign_in user
visit namespace_project_issues_path(project.namespace, project, :atom)
visit project_issues_path(project, :atom)
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
......@@ -30,8 +30,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated via private token' do
it 'renders atom feed' do
visit namespace_project_issues_path(project.namespace, project, :atom,
private_token: user.private_token)
visit project_issues_path(project, :atom, private_token: user.private_token)
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
......@@ -45,8 +44,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated via RSS token' do
it 'renders atom feed' do
visit namespace_project_issues_path(project.namespace, project, :atom,
rss_token: user.rss_token)
visit project_issues_path(project, :atom, rss_token: user.rss_token)
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
......@@ -59,8 +57,7 @@ describe 'Issues Feed', feature: true do
end
it "renders atom feed with url parameters for project issues" do
visit namespace_project_issues_path(project.namespace, project,
:atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
visit project_issues_path(project, :atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
link = find('link[type="application/atom+xml"]')
params = CGI.parse(URI.parse(link[:href]).query)
......
......@@ -16,7 +16,7 @@ describe 'Auto deploy' do
end
it 'does not show a button to set up auto deploy' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
expect(page).to have_no_content('Set up auto deploy')
end
end
......@@ -24,7 +24,7 @@ describe 'Auto deploy' do
context 'when a deployment service is active' do
before do
project.kubernetes_service.update!(active: true)
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
it 'shows a button to set up auto deploy' do
......
......@@ -16,12 +16,12 @@ describe 'Issue Boards add issue modal', :feature, :js do
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
it 'resets filtered search state' do
visit namespace_project_board_path(project.namespace, project, board, search: 'testing')
visit project_board_path(project, board, search: 'testing')
wait_for_requests
......
......@@ -17,7 +17,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'no lists' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
end
......@@ -81,7 +81,7 @@ describe 'Issue Boards', feature: true, js: true do
let!(:issue9) { create(:labeled_issue, project: project, labels: [planning, testing, bug, accepting], relative_position: 1) }
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
......@@ -158,7 +158,7 @@ describe 'Issue Boards', feature: true, js: true do
create(:labeled_issue, project: project, labels: [planning])
end
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
page.within(find('.board:nth-child(2)')) do
......@@ -507,7 +507,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'keyboard shortcuts' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......@@ -520,7 +520,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
sign_out(:user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......@@ -544,7 +544,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user_guest, :guest]
sign_out(:user)
sign_in(user_guest)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......
......@@ -22,7 +22,7 @@ describe 'Issue Boards', :feature, :js do
let!(:issue4) { create(:labeled_issue, project: project, labels: [label]) }
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
......@@ -47,7 +47,7 @@ describe 'Issue Boards', :feature, :js do
context 'ordering in list' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
......@@ -110,7 +110,7 @@ describe 'Issue Boards', :feature, :js do
let!(:issue6) { create(:labeled_issue, project: project, title: 'testing 3', labels: [label2], relative_position: 1.0) }
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 4)
......
......@@ -8,7 +8,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
sign_in(create(:admin))
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
it 'takes user to issue board index' do
......
......@@ -202,7 +202,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
end
def visit_board
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
click_button('Add issues')
......
......@@ -12,7 +12,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
......@@ -83,7 +83,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
context 'unauthorized user' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......
......@@ -22,7 +22,7 @@ describe 'Issue Boards', feature: true, js: true do
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......
......@@ -15,7 +15,7 @@ describe 'Sub-group project issue boards', :feature, :js do
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
......
......@@ -66,7 +66,7 @@ describe 'Commits' do
end
before do
visit namespace_project_commits_path(project.namespace, project, :master)
visit project_commits_path(project, :master)
end
it 'shows correct build status from default branch' do
......@@ -192,7 +192,7 @@ describe 'Commits' do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_commits_path(project.namespace, project, branch_name)
visit project_commits_path(project, branch_name)
end
it 'includes the committed_date for each commit' do
......
......@@ -55,7 +55,6 @@ describe "Container Registry" do
end
def visit_container_registry
visit namespace_project_container_registry_index_path(
project.namespace, project)
visit project_container_registry_index_path(project)
end
end
......@@ -16,7 +16,7 @@ describe 'Copy as GFM', feature: true, js: true do
# `markdown` helper expects a `@project` variable
@project = @feat.project
visit namespace_project_issue_path(@project.namespace, @project, @feat.issue)
visit project_issue_path(@project, @feat.issue)
end
# The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert GitLab Flavored Markdown (GFM) to HTML.
......@@ -121,13 +121,13 @@ describe 'Copy as GFM', feature: true, js: true do
# full issue reference
@feat.issue.to_reference(full: true),
# issue URL
namespace_project_issue_url(@project.namespace, @project, @feat.issue),
project_issue_url(@project, @feat.issue),
# issue URL with note anchor
namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123'),
project_issue_url(@project, @feat.issue, anchor: 'note_123'),
# issue link
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue)})",
"[Issue](#{project_issue_url(@project, @feat.issue)})",
# issue link with note anchor
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123')})"
"[Issue](#{project_issue_url(@project, @feat.issue, anchor: 'note_123')})"
)
verify(
......@@ -466,7 +466,7 @@ describe 'Copy as GFM', feature: true, js: true do
context 'from a diff' do
before do
visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
visit project_commit_path(project, sample_commit.id)
end
context 'selecting one word of text' do
......@@ -507,7 +507,7 @@ describe 'Copy as GFM', feature: true, js: true do
context 'from a blob' do
before do
visit namespace_project_blob_path(project.namespace, project, File.join('master', 'files/ruby/popen.rb'))
visit project_blob_path(project, File.join('master', 'files/ruby/popen.rb'))
wait_for_requests
end
......@@ -549,7 +549,7 @@ describe 'Copy as GFM', feature: true, js: true do
context 'from a GFM code block' do
before do
visit namespace_project_blob_path(project.namespace, project, File.join('markdown', 'doc/api/users.md'))
visit project_blob_path(project, File.join('markdown', 'doc/api/users.md'))
wait_for_requests
end
......
......@@ -16,7 +16,7 @@ feature 'Cycle Analytics', feature: true, js: true do
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
......@@ -39,7 +39,7 @@ feature 'Cycle Analytics', feature: true, js: true do
deploy_master
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
end
it 'shows data on each stage' do
......@@ -71,7 +71,7 @@ feature 'Cycle Analytics', feature: true, js: true do
project.team << [user, :master]
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
......@@ -94,7 +94,7 @@ feature 'Cycle Analytics', feature: true, js: true do
deploy_master
sign_in(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
......
......@@ -10,7 +10,7 @@ feature 'Project member activity', feature: true, js: true do
def visit_activities_and_wait_with_event(event_type)
Event.create(project: project, author_id: user.id, action: event_type)
visit activity_namespace_project_path(project.namespace, project)
visit activity_project_path(project)
wait_for_requests
end
......
......@@ -66,7 +66,7 @@ RSpec.describe 'Dashboard Projects', feature: true do
it 'shows that the last pipeline passed' do
visit dashboard_projects_path
expect(page).to have_xpath("//a[@href='#{pipelines_namespace_project_commit_path(project.namespace, project, project.commit)}']")
expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit)}']")
end
end
end
......@@ -330,7 +330,7 @@ feature 'Dashboard Todos' do
end
it 'links to the pipelines for the merge request' do
href = pipelines_namespace_project_merge_request_path(project.namespace, project, todo.target)
href = pipelines_project_merge_request_path(project, todo.target)
expect(page).to have_link "merge request #{todo.target.to_reference(full: true)}", href
end
......
......@@ -11,7 +11,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
project.add_master(user)
sign_in(user)
visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
visit project_commit_path(project, sample_commit.id)
end
it_behaves_like 'discussion comments', 'commit'
......
......@@ -9,7 +9,7 @@ describe 'Discussion Comments Issue', :feature, :js do
project.add_master(user)
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it_behaves_like 'discussion comments', 'issue'
......
......@@ -9,7 +9,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
project.add_master(user)
sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it_behaves_like 'discussion comments', 'merge request'
......
......@@ -9,7 +9,7 @@ describe 'Discussion Comments Issue', :feature, :js do
project.add_master(user)
sign_in(user)
visit namespace_project_snippet_path(project.namespace, project, snippet)
visit project_snippet_path(project, snippet)
end
it_behaves_like 'discussion comments', 'snippet'
......
......@@ -14,7 +14,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
# Ensure that undiffable.md is in .gitattributes
project.repository.copy_gitattributes(branch)
visit namespace_project_commit_path(project.namespace, project, project.commit(branch))
visit project_commit_path(project, project.commit(branch))
execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });')
end
......@@ -38,7 +38,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
expect(large_diff).not_to have_selector('.code')
expect(large_diff).to have_selector('.nothing-here-block')
visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: "#{large_diff[:id]}_0_1")
visit project_commit_path(project, project.commit(branch), anchor: "#{large_diff[:id]}_0_1")
execute_script('window.location.reload()')
wait_for_requests
......@@ -52,7 +52,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
expect(large_diff).not_to have_selector('.code')
expect(large_diff).to have_selector('.nothing-here-block')
visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: large_diff[:id])
visit project_commit_path(project, project.commit(branch), anchor: large_diff[:id])
execute_script('window.location.reload()')
wait_for_requests
......
......@@ -47,7 +47,7 @@ feature 'Top Plus Menu', feature: true, js: true do
end
scenario 'click on New issue shows new issue page' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
click_topmenuitem("New issue")
......@@ -56,7 +56,7 @@ feature 'Top Plus Menu', feature: true, js: true do
end
scenario 'click on New merge request shows new merge request page' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
click_topmenuitem("New merge request")
......@@ -66,7 +66,7 @@ feature 'Top Plus Menu', feature: true, js: true do
end
scenario 'click on New project snippet shows new snippet page' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click')
......@@ -107,7 +107,7 @@ feature 'Top Plus Menu', feature: true, js: true do
end
scenario 'click on New issue shows new issue page' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
click_topmenuitem("New issue")
......@@ -116,31 +116,31 @@ feature 'Top Plus Menu', feature: true, js: true do
end
scenario 'has no New merge request menu item' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
hasnot_topmenuitem("New merge request")
end
scenario 'has no New project snippet menu item' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
end
scenario 'public project has no New Issue Button' do
visit namespace_project_path(public_project.namespace, public_project)
visit project_path(public_project)
hasnot_topmenuitem("New issue")
end
scenario 'public project has no New merge request menu item' do
visit namespace_project_path(public_project.namespace, public_project)
visit project_path(public_project)
hasnot_topmenuitem("New merge request")
end
scenario 'public project has no New project snippet menu item' do
visit namespace_project_path(public_project.namespace, public_project)
visit project_path(public_project)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
end
......
......@@ -25,25 +25,25 @@ describe "GitLab Flavored Markdown", feature: true do
end
it "renders title in commits#index" do
visit namespace_project_commits_path(project.namespace, project, 'master', limit: 1)
visit project_commits_path(project, 'master', limit: 1)
expect(page).to have_link(issue.to_reference)
end
it "renders title in commits#show" do
visit namespace_project_commit_path(project.namespace, project, commit)
visit project_commit_path(project, commit)
expect(page).to have_link(issue.to_reference)
end
it "renders description in commits#show" do
visit namespace_project_commit_path(project.namespace, project, commit)
visit project_commit_path(project, commit)
expect(page).to have_link(fred.to_reference)
end
it "renders title in repositories#branches" do
visit namespace_project_branches_path(project.namespace, project)
visit project_branches_path(project)
expect(page).to have_link(issue.to_reference)
end
......@@ -66,19 +66,19 @@ describe "GitLab Flavored Markdown", feature: true do
end
it "renders subject in issues#index" do
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
expect(page).to have_link(@other_issue.to_reference)
end
it "renders subject in issues#show" do
visit namespace_project_issue_path(project.namespace, project, @issue)
visit project_issue_path(project, @issue)
expect(page).to have_link(@other_issue.to_reference)
end
it "renders details in issues#show" do
visit namespace_project_issue_path(project.namespace, project, @issue)
visit project_issue_path(project, @issue)
expect(page).to have_link(fred.to_reference)
end
......@@ -92,13 +92,13 @@ describe "GitLab Flavored Markdown", feature: true do
end
it "renders title in merge_requests#index" do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
expect(page).to have_link(issue.to_reference)
end
it "renders title in merge_requests#show" do
visit namespace_project_merge_request_path(project.namespace, project, @merge_request)
visit project_merge_request_path(project, @merge_request)
expect(page).to have_link(issue.to_reference)
end
......@@ -113,19 +113,19 @@ describe "GitLab Flavored Markdown", feature: true do
end
it "renders title in milestones#index" do
visit namespace_project_milestones_path(project.namespace, project)
visit project_milestones_path(project)
expect(page).to have_link(issue.to_reference)
end
it "renders title in milestones#show" do
visit namespace_project_milestone_path(project.namespace, project, @milestone)
visit project_milestone_path(project, @milestone)
expect(page).to have_link(issue.to_reference)
end
it "renders description in milestones#show" do
visit namespace_project_milestone_path(project.namespace, project, @milestone)
visit project_milestone_path(project, @milestone)
expect(page).to have_link(fred.to_reference)
end
......
......@@ -39,9 +39,9 @@ describe 'issuable list', feature: true do
def visit_issuable_list(issuable_type)
if issuable_type == :issue
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
else
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
end
......
......@@ -19,7 +19,7 @@ describe 'Awards Emoji', feature: true do
before do
# The `heart_tip` emoji is not valid anymore so we need to skip validation
issue.award_emoji.build(user: user, name: 'heart_tip').save!(validate: false)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
wait_for_requests
end
......@@ -33,7 +33,7 @@ describe 'Awards Emoji', feature: true do
let!(:note) { create(:note_on_issue, noteable: issue, project: issue.project, note: "Hello world") }
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
wait_for_requests
end
......@@ -97,7 +97,7 @@ describe 'Awards Emoji', feature: true do
context 'unauthorized user', js: true do
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'has disabled emoji button' do
......
......@@ -8,7 +8,7 @@ feature 'Issue awards', js: true, feature: true do
describe 'logged in' do
before do
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
wait_for_requests
end
......@@ -17,7 +17,7 @@ feature 'Issue awards', js: true, feature: true do
expect(page).to have_selector('.js-emoji-btn.active')
expect(first('.js-emoji-btn')).to have_content '1'
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
expect(first('.js-emoji-btn')).to have_content '1'
end
......@@ -26,7 +26,7 @@ feature 'Issue awards', js: true, feature: true do
find('.js-emoji-btn.active').click
expect(first('.js-emoji-btn')).to have_content '0'
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
expect(first('.js-emoji-btn')).to have_content '0'
end
......@@ -40,7 +40,7 @@ feature 'Issue awards', js: true, feature: true do
describe 'logged out' do
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
wait_for_requests
end
......
......@@ -348,7 +348,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before do
sign_in user
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
context 'cannot bulk assign labels' do
......@@ -410,7 +410,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
end
def enable_bulk_update
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
click_button 'Edit Issues'
end
......
......@@ -12,7 +12,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
end
it 'allows creating a merge request from the issue page' do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
select_dropdown_option('create-mr')
......@@ -21,21 +21,21 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
expect(page).to have_content("created branch 1-cherry-coloured-funk")
expect(page).to have_content("mentioned in merge request !1")
visit namespace_project_merge_request_path(project.namespace, project, MergeRequest.first)
visit project_merge_request_path(project, MergeRequest.first)
expect(page).to have_content('WIP: Resolve "Cherry-Coloured Funk"')
expect(current_path).to eq(namespace_project_merge_request_path(project.namespace, project, MergeRequest.first))
expect(current_path).to eq(project_merge_request_path(project, MergeRequest.first))
end
it 'allows creating a branch from the issue page' do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
select_dropdown_option('create-branch')
wait_for_requests
expect(page).to have_selector('.dropdown-toggle-text ', text: '1-cherry-coloured-funk')
expect(current_path).to eq namespace_project_tree_path(project.namespace, project, '1-cherry-coloured-funk')
expect(current_path).to eq project_tree_path(project, '1-cherry-coloured-funk')
end
context "when there is a referenced merge request" do
......@@ -52,7 +52,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
before do
referenced_mr.cache_merge_request_closes_issues!(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'disables the create branch button' do
......@@ -66,7 +66,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
it 'disables the create branch button' do
issue = create(:issue, :confidential, project: project)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
expect(page).not_to have_css('.create-mr-dropdown-wrap')
end
......@@ -75,7 +75,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
context 'for visitors' do
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'shows no buttons' do
......
......@@ -10,12 +10,12 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
before do
project.team << [user, :master]
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows a button to resolve all discussions by creating a new issue' do
within('#resolve-count-app') do
expect(page).to have_link "Resolve all discussions in new issue", href: new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
expect(page).to have_link "Resolve all discussions in new issue", href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
end
......@@ -25,13 +25,13 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
end
it 'hides the link for creating a new issue' do
expect(page).not_to have_link "Resolve all discussions in new issue", href: new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
expect(page).not_to have_link "Resolve all discussions in new issue", href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
end
context 'creating an issue for discussions' do
before do
click_link "Resolve all discussions in new issue", href: new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
click_link "Resolve all discussions in new issue", href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
it_behaves_like 'creating an issue for a discussion'
......@@ -45,7 +45,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
context 'with the internal tracker disabled' do
before do
project.project_feature.update_attribute(:issues_access_level, ProjectFeature::DISABLED)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not show a link to create a new issue' do
......@@ -55,7 +55,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
context 'merge request has discussions that need to be resolved' do
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows a warning that the merge request contains unresolved discussions' do
......@@ -64,13 +64,13 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
it 'has a link to resolve all discussions by creating an issue' do
page.within '.mr-widget-body' do
expect(page).to have_link 'Create an issue to resolve them later', href: new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
expect(page).to have_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
end
context 'creating an issue for discussions' do
before do
page.click_link 'Create an issue to resolve them later', href: new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
page.click_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
it_behaves_like 'creating an issue for a discussion'
......@@ -83,7 +83,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
before do
project.team << [user, :reporter]
sign_in user
visit new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
it 'Shows a notice to ask someone else to resolve the discussions' do
......
......@@ -10,13 +10,13 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
before do
project.team << [user, :master]
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
context 'with the internal tracker disabled' do
before do
project.project_feature.update_attribute(:issues_access_level, ProjectFeature::DISABLED)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not show a link to create a new issue' do
......@@ -43,14 +43,14 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
end
it 'has a link to create a new issue for a discussion' do
new_issue_link = new_namespace_project_issue_path(project.namespace, project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
new_issue_link = new_project_issue_path(project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
expect(page).to have_link 'Resolve this discussion in a new issue', href: new_issue_link
end
context 'creating the issue' do
before do
click_link 'Resolve this discussion in a new issue', href: new_namespace_project_issue_path(project.namespace, project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
click_link 'Resolve this discussion in a new issue', href: new_project_issue_path(project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
end
it 'has a hidden field for the discussion' do
......@@ -67,8 +67,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
before do
project.team << [user, :reporter]
sign_in user
visit new_namespace_project_issue_path(project.namespace, project,
merge_request_to_resolve_discussions_of: merge_request.iid,
visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid,
discussion_to_resolve: discussion.id)
end
......
......@@ -26,7 +26,7 @@ describe 'Dropdown assignee', :feature, :js do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'behavior' do
......
......@@ -34,7 +34,7 @@ describe 'Dropdown author', js: true, feature: true do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'behavior' do
......
......@@ -17,7 +17,7 @@ describe 'Dropdown hint', :js, :feature do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'behavior' do
......
......@@ -37,7 +37,7 @@ describe 'Dropdown label', js: true, feature: true do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'keyboard navigation' do
......
......@@ -33,7 +33,7 @@ describe 'Dropdown milestone', :feature, :js do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'behavior' do
......
......@@ -89,7 +89,7 @@ describe 'Filter issues', js: true, feature: true do
milestone: future_milestone,
project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'filter issues by author' do
......@@ -804,7 +804,7 @@ describe 'Filter issues', js: true, feature: true do
describe 'RSS feeds' do
it 'updates atom feed link for project issues' do
visit namespace_project_issues_path(project.namespace, project, milestone_title: milestone.title, assignee_id: user.id)
visit project_issues_path(project, milestone_title: milestone.title, assignee_id: user.id)
link = find_link('Subscribe')
params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
......@@ -836,7 +836,7 @@ describe 'Filter issues', js: true, feature: true do
context 'URL has a trailing slash' do
before do
visit "#{namespace_project_issues_path(project.namespace, project)}/"
visit "#{project_issues_path(project)}/"
end
it 'milestone dropdown loads milestones' do
......
......@@ -22,7 +22,7 @@ describe 'Recent searches', js: true, feature: true do
end
it 'searching adds to recent searches' do
visit namespace_project_issues_path(project_1.namespace, project_1)
visit project_issues_path(project_1)
input_filtered_search('foo', submit: true)
input_filtered_search('bar', submit: true)
......@@ -35,8 +35,8 @@ describe 'Recent searches', js: true, feature: true do
end
it 'visiting URL with search params adds to recent searches' do
visit namespace_project_issues_path(project_1.namespace, project_1, label_name: 'foo', search: 'bar')
visit namespace_project_issues_path(project_1.namespace, project_1, label_name: 'qux', search: 'garply')
visit project_issues_path(project_1, label_name: 'foo', search: 'bar')
visit project_issues_path(project_1, label_name: 'qux', search: 'garply')
items = all('.filtered-search-history-dropdown-item', visible: false)
......@@ -48,7 +48,7 @@ describe 'Recent searches', js: true, feature: true do
it 'saved recent searches are restored last on the list' do
set_recent_searches(project_1_local_storage_key, '["saved1", "saved2"]')
visit namespace_project_issues_path(project_1.namespace, project_1, search: 'foo')
visit project_issues_path(project_1, search: 'foo')
items = all('.filtered-search-history-dropdown-item', visible: false)
......@@ -59,12 +59,12 @@ describe 'Recent searches', js: true, feature: true do
end
it 'searches are scoped to projects' do
visit namespace_project_issues_path(project_1.namespace, project_1)
visit project_issues_path(project_1)
input_filtered_search('foo', submit: true)
input_filtered_search('bar', submit: true)
visit namespace_project_issues_path(project_2.namespace, project_2)
visit project_issues_path(project_2)
input_filtered_search('more', submit: true)
input_filtered_search('things', submit: true)
......@@ -78,7 +78,7 @@ describe 'Recent searches', js: true, feature: true do
it 'clicking item fills search input' do
set_recent_searches(project_1_local_storage_key, '["foo", "bar"]')
visit namespace_project_issues_path(project_1.namespace, project_1)
visit project_issues_path(project_1)
all('.filtered-search-history-dropdown-item', visible: false)[0].trigger('click')
wait_for_filtered_search('foo')
......@@ -88,7 +88,7 @@ describe 'Recent searches', js: true, feature: true do
it 'clear recent searches button, clears recent searches' do
set_recent_searches(project_1_local_storage_key, '["foo"]')
visit namespace_project_issues_path(project_1.namespace, project_1)
visit project_issues_path(project_1)
items_before = all('.filtered-search-history-dropdown-item', visible: false)
......@@ -102,7 +102,7 @@ describe 'Recent searches', js: true, feature: true do
it 'shows flash error when failed to parse saved history' do
set_recent_searches(project_1_local_storage_key, 'fail')
visit namespace_project_issues_path(project_1.namespace, project_1)
visit project_issues_path(project_1)
expect(find('.flash-alert')).to have_text('An error occured while parsing recent searches')
end
......
......@@ -12,7 +12,7 @@ describe 'Search bar', js: true, feature: true do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
def get_left_style(style)
......
......@@ -28,7 +28,7 @@ describe 'Visual tokens', js: true, feature: true do
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
end
describe 'editing author token' do
......
......@@ -21,7 +21,7 @@ describe 'New/edit issue', :feature, :js do
context 'new issue' do
before do
visit new_namespace_project_issue_path(project.namespace, project)
visit new_project_issue_path(project)
end
describe 'shorten users API pagination limit (CE)' do
......@@ -39,7 +39,7 @@ describe 'New/edit issue', :feature, :js do
options
end
visit new_namespace_project_issue_path(project.namespace, project)
visit new_project_issue_path(project)
click_button 'Unassigned'
......@@ -221,7 +221,7 @@ describe 'New/edit issue', :feature, :js do
context 'edit issue' do
before do
visit edit_namespace_project_issue_path(project.namespace, project, issue)
visit edit_project_issue_path(project, issue)
end
it 'allows user to update issue' do
......@@ -282,7 +282,7 @@ describe 'New/edit issue', :feature, :js do
before do
sub_group_project.add_master(user)
visit new_namespace_project_issue_path(sub_group_project.namespace, sub_group_project)
visit new_project_issue_path(sub_group_project)
end
it 'creates new label from dropdown' do
......
......@@ -9,7 +9,7 @@ feature 'GFM autocomplete', feature: true, js: true do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
wait_for_requests
end
......
......@@ -6,13 +6,9 @@ describe 'Group label on issue', :feature do
project = create(:empty_project, :public, namespace: group)
feature = create(:group_label, group: group, title: 'feature')
issue = create(:labeled_issue, project: project, labels: [feature])
label_link = namespace_project_issues_path(
project.namespace,
project,
label_name: [feature.name]
)
label_link = project_issues_path(project, label_name: [feature.name])
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
link = find('.issuable-show-labels a')
......
......@@ -180,7 +180,7 @@ feature 'Issue Sidebar', feature: true do
end
def visit_issue(project, issue)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
def open_issue_sidebar
......
......@@ -8,7 +8,7 @@ feature 'Issue markdown toolbar', feature: true, js: true do
before do
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it "doesn't include first new line when adding bold" do
......
......@@ -98,10 +98,10 @@ feature 'issue move to another project' do
end
def issue_path(issue)
namespace_project_issue_path(issue.project.namespace, issue.project, issue)
project_issue_path(issue.project, issue)
end
def project_path(project)
namespace_project_path(new_project.namespace, new_project)
project_path(new_project)
end
end
......@@ -8,7 +8,7 @@ feature 'Issue notes polling', :feature, :js do
describe 'creates' do
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'displays the new comment' do
......@@ -28,7 +28,7 @@ feature 'Issue notes polling', :feature, :js do
before do
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'has .original-note-content to compare against' do
......@@ -94,7 +94,7 @@ feature 'Issue notes polling', :feature, :js do
before do
sign_in(user2)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'has .original-note-content to compare against' do
......@@ -115,7 +115,7 @@ feature 'Issue notes polling', :feature, :js do
before do
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'has .original-note-content to compare against' do
......
......@@ -10,7 +10,7 @@ describe 'Create notes on issues', :js, :feature do
before do
project.team << [user, :developer]
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
fill_in 'note[note]', with: note_text
click_button 'Comment'
......
......@@ -25,7 +25,7 @@ describe 'New issue', feature: true, js: true do
before do
WebMock.stub_request(:any, /.*akismet.com.*/).to_return(body: "true", status: 200)
visit new_namespace_project_issue_path(project.namespace, project)
visit new_project_issue_path(project)
end
it 'creates an issue after solving reCaptcha' do
......@@ -50,7 +50,7 @@ describe 'New issue', feature: true, js: true do
before do
WebMock.stub_request(:any, /.*akismet.com.*/).to_return(body: 'false', status: 200)
visit new_namespace_project_issue_path(project.namespace, project)
visit new_project_issue_path(project)
end
it 'creates an issue' do
......
......@@ -8,7 +8,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'creates todo when clicking button' do
......@@ -21,7 +21,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
expect(page).to have_content '1'
end
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
page.within '.header-content .todos-count' do
expect(page).to have_content '1'
......@@ -36,7 +36,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
expect(page).to have_selector('.todos-count', visible: false)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
expect(page).to have_selector('.todos-count', visible: false)
end
......
......@@ -12,7 +12,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
context 'status', js: true do
it 'sets to closed' do
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
click_button 'Edit Issues'
find('#check-all-issues').click
......@@ -25,7 +25,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
it 'sets to open' do
create_closed
visit namespace_project_issues_path(project.namespace, project, state: 'closed')
visit project_issues_path(project, state: 'closed')
click_button 'Edit Issues'
find('#check-all-issues').click
......@@ -39,7 +39,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
context 'assignee', js: true do
it 'updates to current user' do
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
click_button 'Edit Issues'
find('#check-all-issues').click
......@@ -55,7 +55,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
it 'updates to unassigned' do
create_assigned
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
click_button 'Edit Issues'
find('#check-all-issues').click
......@@ -71,7 +71,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
let(:milestone) { create(:milestone, project: project) }
it 'updates milestone' do
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
click_button 'Edit Issues'
find('#check-all-issues').click
......@@ -85,7 +85,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
it 'sets to no milestone' do
create_with_milestone
visit namespace_project_issues_path(project.namespace, project)
visit project_issues_path(project)
expect(first('.issue')).to have_content milestone.title
......
......@@ -14,7 +14,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
after do
......@@ -43,7 +43,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
project.team << [guest, :guest]
sign_out(:user)
sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'does not create a note, and sets the due date accordingly' do
......@@ -83,7 +83,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
project.team << [guest, :guest]
sign_out(:user)
sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it 'does not create a note, and sets the due date accordingly' do
......@@ -108,7 +108,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
context 'Issue' do
before do
visit namespace_project_issue_path(project.namespace, project, issue)
visit project_issue_path(project, issue)
end
it_behaves_like 'issuable time tracker'
......@@ -118,7 +118,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
let(:merge_request) { create(:merge_request, source_project: project) }
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it_behaves_like 'issuable time tracker'
......
This diff is collapsed.
......@@ -14,7 +14,7 @@ feature 'Merge request issue assignment', js: true, feature: true do
def visit_merge_request(current_user = nil)
sign_in(current_user || user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
context 'logged in as author' do
......
......@@ -8,7 +8,7 @@ feature 'Merge request awards', js: true, feature: true do
describe 'logged in' do
before do
sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'adds award to merge request' do
......@@ -16,7 +16,7 @@ feature 'Merge request awards', js: true, feature: true do
expect(page).to have_selector('.js-emoji-btn.active')
expect(first('.js-emoji-btn')).to have_content '1'
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(first('.js-emoji-btn')).to have_content '1'
end
......@@ -25,7 +25,7 @@ feature 'Merge request awards', js: true, feature: true do
find('.js-emoji-btn.active').click
expect(first('.js-emoji-btn')).to have_content '0'
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(first('.js-emoji-btn')).to have_content '0'
end
......@@ -39,7 +39,7 @@ feature 'Merge request awards', js: true, feature: true do
describe 'logged out' do
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not see award menu button' do
......
......@@ -64,6 +64,6 @@ feature 'Check if mergeable with unresolved discussions', js: true, feature: tru
end
def visit_merge_request(merge_request)
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
visit project_merge_request_path(merge_request.project, merge_request)
end
end
......@@ -28,7 +28,7 @@ describe 'Cherry-pick Merge Requests', js: true do
end
it "doesn't show a Cherry-pick button" do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(page).not_to have_link "Cherry-pick"
end
......@@ -36,7 +36,7 @@ describe 'Cherry-pick Merge Requests', js: true do
context "With a merge commit" do
it "shows a Cherry-pick button" do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(page).to have_link "Cherry-pick"
end
......
......@@ -22,7 +22,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
wait_for_requests
end
......
......@@ -86,7 +86,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
let(:merge_request) { create_merge_request('conflict-resolvable') }
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows a link to the conflict resolution page' do
......@@ -117,7 +117,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
let(:merge_request) { create_merge_request('conflict-contains-conflict-markers') }
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
click_link('conflicts', href: /\/conflicts\Z/)
end
......@@ -166,7 +166,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
project.team << [user, :developer]
sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not show a link to the conflict resolution page' do
......
......@@ -11,7 +11,7 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'selects the source branch sha when a tag with the same name exists' do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
click_link 'New merge request'
expect(page).to have_content('Source branch')
......@@ -24,7 +24,7 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'selects the target branch sha when a tag with the same name exists' do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
click_link 'New merge request'
......@@ -38,7 +38,7 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'generates a diff for an orphaned branch' do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request')
expect(page).to have_content('Source branch')
......@@ -65,7 +65,7 @@ feature 'Create New Merge Request', feature: true, js: true do
it 'does not leak the private project name & namespace' do
private_project = create(:project, :private)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_project_id: private_project.id })
visit project_new_merge_request_path(project, merge_request: { target_project_id: private_project.id })
expect(page).not_to have_content private_project.path_with_namespace
expect(page).to have_content project.path_with_namespace
......@@ -76,7 +76,7 @@ feature 'Create New Merge Request', feature: true, js: true do
it 'does not leak the private project name & namespace' do
private_project = create(:project, :private)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { source_project_id: private_project.id })
visit project_new_merge_request_path(project, merge_request: { source_project_id: private_project.id })
expect(page).not_to have_content private_project.path_with_namespace
expect(page).to have_content project.path_with_namespace
......@@ -84,13 +84,13 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'populates source branch button' do
visit namespace_project_new_merge_request_path(project.namespace, project, change_branches: true, merge_request: { target_branch: 'master', source_branch: 'fix' })
visit project_new_merge_request_path(project, change_branches: true, merge_request: { target_branch: 'master', source_branch: 'fix' })
expect(find('.js-source-branch')).to have_content('fix')
end
it 'allows to change the diff view' do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'fix' })
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'fix' })
click_link 'Changes'
......@@ -106,7 +106,7 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'does not allow non-existing branches' do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'non-exist-target', source_branch: 'non-exist-source' })
visit project_new_merge_request_path(project, merge_request: { target_branch: 'non-exist-target', source_branch: 'non-exist-source' })
expect(page).to have_content('The form contains the following errors')
expect(page).to have_content('Source branch "non-exist-source" does not exist')
......@@ -115,7 +115,7 @@ feature 'Create New Merge Request', feature: true, js: true do
context 'when a branch contains commits that both delete and add the same image' do
it 'renders the diff successfully' do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'deleted-image-test' })
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'deleted-image-test' })
click_link "Changes"
......@@ -125,7 +125,7 @@ feature 'Create New Merge Request', feature: true, js: true do
# Isolates a regression (see #24627)
it 'does not show error messages on initial form' do
visit namespace_project_new_merge_request_path(project.namespace, project)
visit project_new_merge_request_path(project)
expect(page).not_to have_selector('#error_explanation')
expect(page).not_to have_content('The form contains the following error')
end
......@@ -138,9 +138,7 @@ feature 'Create New Merge Request', feature: true, js: true do
end
it 'shows pipelines for a new merge request' do
visit namespace_project_new_merge_request_path(
project.namespace, project,
merge_request: { target_branch: 'master', source_branch: 'fix' })
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'fix' })
page.within('.merge-request') do
click_link 'Pipelines'
......
......@@ -64,7 +64,6 @@ feature 'Merge request created from fork' do
end
def visit_merge_request(mr)
visit namespace_project_merge_request_path(project.namespace,
project, mr)
visit project_merge_request_path(project, mr)
end
end
......@@ -11,11 +11,7 @@ describe 'Deleted source branch', feature: true, js: true do
sign_in user
merge_request.project.team << [user, :master]
merge_request.update!(source_branch: 'this-branch-does-not-exist')
visit namespace_project_merge_request_path(
merge_request.project.namespace,
merge_request.project,
merge_request
)
visit project_merge_request_path(merge_request.project, merge_request)
end
it 'shows a message about missing source branch' do
......
......@@ -25,7 +25,7 @@ feature 'Diff note avatars', feature: true, js: true do
context 'discussion tab' do
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not show avatars on discussion tab' do
......@@ -50,7 +50,7 @@ feature 'Diff note avatars', feature: true, js: true do
context 'commit view' do
before do
visit namespace_project_commit_path(project.namespace, project, merge_request.commits.first.id)
visit project_commit_path(project, merge_request.commits.first.id)
end
it 'does not render avatar after commenting' do
......@@ -65,7 +65,7 @@ feature 'Diff note avatars', feature: true, js: true do
wait_for_requests
end
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(page).to have_content('test comment')
expect(page).not_to have_selector('.js-avatar-container')
......@@ -76,7 +76,7 @@ feature 'Diff note avatars', feature: true, js: true do
%w(inline parallel).each do |view|
context "#{view} view" do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view)
visit diffs_project_merge_request_path(project, merge_request, view: view)
wait_for_requests
end
......@@ -168,7 +168,7 @@ feature 'Diff note avatars', feature: true, js: true do
before do
create_list(:diff_note_on_merge_request, 3, project: project, noteable: merge_request, in_reply_to: note)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view)
visit diffs_project_merge_request_path(project, merge_request, view: view)
wait_for_requests
end
......
......@@ -494,6 +494,6 @@ feature 'Diff notes resolve', feature: true, js: true do
def visit_merge_request(mr = nil)
mr = mr || merge_request
visit namespace_project_merge_request_path(mr.project.namespace, mr.project, mr)
visit project_merge_request_path(mr.project, mr)
end
end
......@@ -12,7 +12,7 @@ feature 'Diffs URL', js: true, feature: true do
it 'renders the notes' do
create :note_on_merge_request, project: project, noteable: merge_request, note: 'Rebasing with master'
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
# Load notes and diff through AJAX
expect(page).to have_css('.note-text', visible: false, text: 'Rebasing with master')
......@@ -26,7 +26,7 @@ feature 'Diffs URL', js: true, feature: true do
let(:fragment) { "#note_#{note.id}" }
before do
visit "#{diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)}#{fragment}"
visit "#{diffs_project_merge_request_path(project, merge_request)}#{fragment}"
end
it 'shows expanded note' do
......@@ -39,7 +39,7 @@ feature 'Diffs URL', js: true, feature: true do
let(:fragment) { "#note_#{note.id}" }
before do
visit "#{diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)}#{fragment}"
visit "#{diffs_project_merge_request_path(project, merge_request)}#{fragment}"
end
it 'shows expanded note' do
......@@ -52,7 +52,7 @@ feature 'Diffs URL', js: true, feature: true do
it 'displays warning' do
allow(Commit).to receive(:max_diff_options).and_return(max_files: 3)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
page.within('.alert') do
expect(page).to have_text("Too many changes to show. Plain diff Email patch To preserve
......@@ -75,7 +75,7 @@ feature 'Diffs URL', js: true, feature: true do
context 'as author' do
it 'shows direct edit link' do
sign_in(author_user)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
# Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax
expect(page).to have_selector("[id=\"#{changelog_id}\"] a.js-edit-blob")
......@@ -85,7 +85,7 @@ feature 'Diffs URL', js: true, feature: true do
context 'as user who needs to fork' do
it 'shows fork/cancel confirmation' do
sign_in(user)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
# Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax
find("[id=\"#{changelog_id}\"] .js-edit-blob").click
......
......@@ -27,13 +27,13 @@ feature 'Merge Request Discussions', feature: true do
let(:outdated_diff_refs) { project.commit("874797c3a73b60d2187ed6e2fcabd289ff75171e").diff_refs }
before(:each) do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
context 'active discussions' do
it 'shows a link to the diff' do
within(".discussion[data-discussion-id='#{active_discussion.id}']") do
path = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, anchor: active_discussion.line_code)
path = diffs_project_merge_request_path(project, merge_request, anchor: active_discussion.line_code)
expect(page).to have_link('the diff', href: path)
end
end
......@@ -42,7 +42,7 @@ feature 'Merge Request Discussions', feature: true do
context 'outdated discussions' do
it 'shows a link to the outdated diff' do
within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do
path = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, diff_id: old_merge_request_diff.id, anchor: outdated_discussion.line_code)
path = diffs_project_merge_request_path(project, merge_request, diff_id: old_merge_request_diff.id, anchor: outdated_discussion.line_code)
expect(page).to have_link('an old version of the diff', href: path)
end
end
......@@ -72,7 +72,7 @@ feature 'Merge Request Discussions', feature: true do
end
before(:each) do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
context 'a regular commit comment' do
......
......@@ -10,7 +10,7 @@ feature 'Edit Merge Request', feature: true do
sign_in user
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit edit_project_merge_request_path(project, merge_request)
end
context 'editing a MR' do
......@@ -33,7 +33,7 @@ feature 'Edit Merge Request', feature: true do
merge_request.update(merge_params: { 'force_remove_source_branch' => '1' })
expect(merge_request.merge_params['force_remove_source_branch']).to be_truthy
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit edit_project_merge_request_path(project, merge_request)
uncheck 'Remove source branch when merge request is accepted'
click_button 'Save changes'
......
......@@ -28,7 +28,7 @@ feature 'Issue filtering by Labels', feature: true, js: true do
project.team << [user, :master]
sign_in(user)
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
context 'filter by label bug' do
......
......@@ -17,7 +17,7 @@ describe 'Filter merge requests', feature: true do
sign_in(user)
create(:merge_request, source_project: project, target_project: project)
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
describe 'for assignee from mr#index' do
......@@ -191,7 +191,7 @@ describe 'Filter merge requests', feature: true do
assignee: user)
mr.labels << bug_label
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
context 'only text', js: true do
......@@ -275,7 +275,7 @@ describe 'Filter merge requests', feature: true do
mr1.labels << bug_label
mr2.labels << bug_label
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it 'is able to filter and sort merge requests' do
......@@ -297,7 +297,7 @@ describe 'Filter merge requests', feature: true do
describe 'filter by assignee id', js: true do
it 'filter by current user' do
visit namespace_project_merge_requests_path(project.namespace, project, assignee_id: user.id)
visit project_merge_requests_path(project, assignee_id: user.id)
expect_tokens([{ name: 'assignee', value: "@#{user.username}" }])
expect_filtered_search_input_empty
......@@ -307,7 +307,7 @@ describe 'Filter merge requests', feature: true do
new_user = create(:user)
project.add_developer(new_user)
visit namespace_project_merge_requests_path(project.namespace, project, assignee_id: new_user.id)
visit project_merge_requests_path(project, assignee_id: new_user.id)
expect_tokens([{ name: 'assignee', value: "@#{new_user.username}" }])
expect_filtered_search_input_empty
......@@ -316,7 +316,7 @@ describe 'Filter merge requests', feature: true do
describe 'filter by author id', js: true do
it 'filter by current user' do
visit namespace_project_merge_requests_path(project.namespace, project, author_id: user.id)
visit project_merge_requests_path(project, author_id: user.id)
expect_tokens([{ name: 'author', value: "@#{user.username}" }])
expect_filtered_search_input_empty
......@@ -326,7 +326,7 @@ describe 'Filter merge requests', feature: true do
new_user = create(:user)
project.add_developer(new_user)
visit namespace_project_merge_requests_path(project.namespace, project, author_id: new_user.id)
visit project_merge_requests_path(project, author_id: new_user.id)
expect_tokens([{ name: 'author', value: "@#{new_user.username}" }])
expect_filtered_search_input_empty
......
......@@ -23,10 +23,7 @@ describe 'New/edit merge request', feature: true, js: true do
context 'new merge request' do
before do
visit namespace_project_new_merge_request_path(
project.namespace,
project,
merge_request: {
visit project_new_merge_request_path(project, merge_request: {
source_project_id: project.id,
target_project_id: project.id,
source_branch: 'fix',
......@@ -114,7 +111,7 @@ describe 'New/edit merge request', feature: true, js: true do
target_branch: 'master'
)
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit edit_project_merge_request_path(project, merge_request)
end
it 'updates merge request' do
......@@ -182,10 +179,7 @@ describe 'New/edit merge request', feature: true, js: true do
context 'new merge request' do
before do
visit namespace_project_new_merge_request_path(
fork_project.namespace,
fork_project,
merge_request: {
visit project_new_merge_request_path(fork_project, merge_request: {
source_project_id: fork_project.id,
target_project_id: project.id,
source_branch: 'fix',
......@@ -251,7 +245,7 @@ describe 'New/edit merge request', feature: true, js: true do
target_branch: 'master'
)
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit edit_project_merge_request_path(project, merge_request)
end
it 'should update merge request' do
......
......@@ -36,7 +36,7 @@ feature 'Clicking toggle commit message link', feature: true, js: true do
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
expect(page).not_to have_selector('.js-commit-message')
click_button "Modify commit message"
......
......@@ -29,7 +29,7 @@ feature 'Merge immediately', :feature, :js do
before do
sign_in user
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
visit project_merge_request_path(merge_request.project, merge_request)
end
it 'enables merge immediately' do
......
......@@ -155,6 +155,6 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do
end
def visit_merge_request(merge_request)
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
visit project_merge_request_path(merge_request.project, merge_request)
end
end
......@@ -16,7 +16,7 @@ feature 'Mini Pipeline Graph', :js, :feature do
end
def visit_merge_request(format = :html)
visit namespace_project_merge_request_path(project.namespace, project, merge_request, format: format)
visit project_merge_request_path(project, merge_request, format: format)
end
it 'should display a mini pipeline graph' do
......@@ -111,7 +111,7 @@ feature 'Mini Pipeline Graph', :js, :feature do
build_item.click
find('.build-page')
expect(current_path).to eql(namespace_project_job_path(project.namespace, project, build))
expect(current_path).to eql(project_job_path(project, build))
end
it 'should show tooltip when hovered' do
......
......@@ -145,6 +145,6 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
end
def visit_merge_request(merge_request)
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
visit project_merge_request_path(merge_request.project, merge_request)
end
end
......@@ -19,7 +19,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do
end
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
scenario 'user visits merge request pipelines tab' do
......@@ -34,7 +34,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do
context 'without pipelines' do
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
scenario 'user visits merge request page' do
......
......@@ -6,10 +6,7 @@ describe 'Target branch', feature: true, js: true do
let(:project) { merge_request.project }
def path_to_merge_request
namespace_project_merge_request_path(
project.namespace,
project, merge_request
)
project_merge_request_path(project, merge_request)
end
before do
......
......@@ -5,7 +5,7 @@ feature 'Toggle Whitespace Changes', js: true, feature: true do
sign_in(create(:admin))
merge_request = create(:merge_request)
project = merge_request.source_project
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
end
it 'has a button to toggle whitespace changes' do
......
......@@ -11,7 +11,7 @@ feature 'toggler_behavior', js: true, feature: true do
sign_in(create(:admin))
project = merge_request.source_project
page.current_window.resize_to(1000, 300)
visit "#{namespace_project_merge_request_path(project.namespace, project, merge_request)}#{fragment_id}"
visit "#{project_merge_request_path(project, merge_request)}#{fragment_id}"
end
describe 'scroll position' do
......
......@@ -13,7 +13,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
context 'status', js: true do
describe 'close merge request' do
before do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it 'closes merge request' do
......@@ -26,7 +26,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
describe 'reopen merge request' do
before do
merge_request.close
visit namespace_project_merge_requests_path(project.namespace, project, state: 'closed')
visit project_merge_requests_path(project, state: 'closed')
end
it 'reopens merge request' do
......@@ -40,7 +40,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
context 'assignee', js: true do
describe 'set assignee' do
before do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it "updates merge request with assignee" do
......@@ -56,7 +56,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
before do
merge_request.assignee = user
merge_request.save
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it "removes assignee from the merge request" do
......@@ -72,7 +72,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
describe 'set milestone' do
before do
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it "updates merge request with milestone" do
......@@ -86,7 +86,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
before do
merge_request.milestone = milestone
merge_request.save
visit namespace_project_merge_requests_path(project.namespace, project)
visit project_merge_requests_path(project)
end
it "removes milestone from the merge request" do
......
......@@ -37,7 +37,7 @@ describe 'Projects > Merge requests > User lists merge requests', feature: true
it 'filters on no assignee' do
visit_merge_requests(project, assignee_id: IssuableFinder::NONE)
expect(current_path).to eq(namespace_project_merge_requests_path(project.namespace, project))
expect(current_path).to eq(project_merge_requests_path(project))
expect(page).to have_content 'merge_lfs'
expect(page).not_to have_content 'fix'
expect(page).not_to have_content 'markdown'
......@@ -136,8 +136,7 @@ describe 'Projects > Merge requests > User lists merge requests', feature: true
end
it 'sorts by recently due milestone' do
visit namespace_project_merge_requests_path(project.namespace, project,
label_name: [label.name, label2.name],
visit project_merge_requests_path(project, label_name: [label.name, label2.name],
assignee_id: user.id,
sort: sort_value_milestone_soon)
......
......@@ -17,7 +17,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'when hovering over a parallel view diff file' do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'parallel')
visit diffs_project_merge_request_path(project, merge_request, view: 'parallel')
end
context 'with an old line on the left and no line on the right' do
......@@ -92,7 +92,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'when hovering over an inline view diff file' do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'inline')
visit diffs_project_merge_request_path(project, merge_request, view: 'inline')
end
context 'with a new line' do
......@@ -136,9 +136,9 @@ feature 'Merge requests > User posts diff notes', :js do
context 'when hovering over a diff discussion' do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'inline')
visit diffs_project_merge_request_path(project, merge_request, view: 'inline')
should_allow_commenting(find('[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"]'))
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not allow commenting' do
......@@ -149,7 +149,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'when cancelling the comment addition' do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'inline')
visit diffs_project_merge_request_path(project, merge_request, view: 'inline')
end
context 'with a new line' do
......@@ -161,7 +161,7 @@ feature 'Merge requests > User posts diff notes', :js do
describe 'with muliple note forms' do
before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'inline')
visit diffs_project_merge_request_path(project, merge_request, view: 'inline')
click_diff_line(find('[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"]'))
click_diff_line(find('[id="6eb14e00385d2fb284765eb1cd8d420d33d63fc9_22_22"]'))
end
......@@ -181,7 +181,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'when the MR only supports legacy diff notes' do
before do
merge_request.merge_request_diff.update_attributes(start_commit_sha: nil)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: 'inline')
visit diffs_project_merge_request_path(project, merge_request, view: 'inline')
end
context 'with a new line' do
......
......@@ -14,7 +14,7 @@ describe 'Merge requests > User posts notes', :js do
before do
sign_in(create(:admin))
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
subject { page }
......
......@@ -15,7 +15,7 @@ feature 'Merge requests > User sees system notes' do
end
it 'shows the system note' do
visit namespace_project_merge_request_path(public_project.namespace, public_project, merge_request)
visit project_merge_request_path(public_project, merge_request)
expect(page).to have_css('.system-note')
end
......@@ -23,7 +23,7 @@ feature 'Merge requests > User sees system notes' do
context 'when not logged-in' do
it 'hides the system note' do
visit namespace_project_merge_request_path(public_project.namespace, public_project, merge_request)
visit project_merge_request_path(public_project, merge_request)
expect(page).not_to have_css('.system-note')
end
......
......@@ -17,7 +17,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
after do
......@@ -53,7 +53,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
project.team << [guest, :guest]
sign_out(:user)
sign_in(guest)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not change the WIP prefix' do
......@@ -99,7 +99,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
project.team << [guest, :guest]
sign_out(:user)
sign_in(guest)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not merge the MR' do
......@@ -131,7 +131,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
end
it 'changes target_branch in new merge_request' do
visit namespace_project_new_merge_request_path(another_project.namespace, another_project, new_url_opts)
visit project_new_merge_request_path(another_project, new_url_opts)
fill_in "merge_request_title", with: 'My brand new feature'
fill_in "merge_request_description", with: "le feature \n/target_branch fix\nFeature description:"
......@@ -145,7 +145,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
it 'does not change target branch when merge request is edited' do
new_merge_request = create(:merge_request, source_project: another_project)
visit edit_namespace_project_merge_request_path(another_project.namespace, another_project, new_merge_request)
visit edit_project_merge_request_path(another_project, new_merge_request)
fill_in "merge_request_description", with: "Want to update target branch\n/target_branch fix\n"
click_button "Save changes"
......@@ -183,7 +183,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
project.team << [guest, :guest]
sign_out(:user)
sign_in(guest)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'does not change target branch' do
......
......@@ -9,7 +9,7 @@ feature 'Merge Request versions', js: true, feature: true do
before do
sign_in(create(:admin))
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
visit diffs_project_merge_request_path(project, merge_request)
end
it 'show the latest version of the diff' do
......@@ -96,13 +96,8 @@ feature 'Merge Request versions', js: true, feature: true do
end
it 'has a path with comparison context' do
expect(page).to have_current_path diffs_namespace_project_merge_request_path(
project.namespace,
project,
merge_request.iid,
diff_id: merge_request_diff3.id,
start_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
)
expect(page).to have_current_path diffs_project_merge_request_path(project, merge_request.iid, diff_id: merge_request_diff3.id,
start_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9')
end
it 'should have correct value in the compare dropdown' do
......
......@@ -14,7 +14,7 @@ feature 'Widget Deployments Header', feature: true, js: true do
background do
sign_in(user)
project.team << [user, role]
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
scenario 'displays that the environment is deployed' do
......
......@@ -12,16 +12,12 @@ describe 'Merge request', :feature, :js do
context 'new merge request' do
before do
visit namespace_project_new_merge_request_path(
project.namespace,
project,
merge_request: {
visit project_new_merge_request_path(project, merge_request: {
source_project_id: project.id,
target_project_id: project.id,
source_branch: 'feature',
target_branch: 'master'
}
)
})
end
it 'shows widget status after creating new merge request' do
......@@ -44,7 +40,7 @@ describe 'Merge request', :feature, :js do
end
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows environments link' do
......@@ -71,7 +67,7 @@ describe 'Merge request', :feature, :js do
type: 'CiService',
category: 'ci')
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'has danger button while waiting for external CI status' do
......@@ -92,7 +88,7 @@ describe 'Merge request', :feature, :js do
head_pipeline_of: merge_request)
create(:ci_build, :pending, pipeline: pipeline)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'has danger button when not succeeded' do
......@@ -112,9 +108,7 @@ describe 'Merge request', :feature, :js do
status: :manual,
head_pipeline_of: merge_request)
visit namespace_project_merge_request_path(project.namespace,
project,
merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows information about blocked pipeline' do
......@@ -136,7 +130,7 @@ describe 'Merge request', :feature, :js do
head_pipeline_of: merge_request)
create(:ci_build, :pending, pipeline: pipeline)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'has info button when MWBS button' do
......@@ -154,7 +148,7 @@ describe 'Merge request', :feature, :js do
merge_error: 'Something went wrong'
)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows information about the merge error' do
......@@ -175,7 +169,7 @@ describe 'Merge request', :feature, :js do
merge_error: 'Something went wrong'
)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'shows information about the merge error' do
......@@ -191,7 +185,7 @@ describe 'Merge request', :feature, :js do
context 'merge error' do
before do
allow_any_instance_of(Repository).to receive(:merge).and_return(false)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'updates the MR widget' do
......@@ -212,7 +206,7 @@ describe 'Merge request', :feature, :js do
sign_out(:user)
sign_in(user2)
merge_request.update(target_project: fork_project)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
visit project_merge_request_path(project, merge_request)
end
it 'user can merge into the source project' do
......
......@@ -11,16 +11,12 @@ feature 'Work In Progress help message', feature: true do
context 'with WIP commits' do
it 'shows a specific WIP hint' do
visit namespace_project_new_merge_request_path(
project.namespace,
project,
merge_request: {
visit project_new_merge_request_path(project, merge_request: {
source_project_id: project.id,
target_project_id: project.id,
source_branch: 'wip',
target_branch: 'master'
}
)
})
within_wip_explanation do
expect(page).to have_text(
......@@ -32,16 +28,12 @@ feature 'Work In Progress help message', feature: true do
context 'without WIP commits' do
it 'shows the regular WIP message' do
visit namespace_project_new_merge_request_path(
project.namespace,
project,
merge_request: {
visit project_new_merge_request_path(project, merge_request: {
source_project_id: project.id,
target_project_id: project.id,
source_branch: 'fix',
target_branch: 'master'
}
)
})
within_wip_explanation do
expect(page).not_to have_text(
......
......@@ -11,7 +11,7 @@ feature 'Milestone', feature: true do
feature 'Create a milestone' do
scenario 'shows an informative message for a new milestone' do
visit new_namespace_project_milestone_path(project.namespace, project)
visit new_project_milestone_path(project)
page.within '.milestone-form' do
fill_in "milestone_title", with: '8.7'
......@@ -31,7 +31,7 @@ feature 'Milestone', feature: true do
milestone = create(:milestone, project: project, title: 8.7)
create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed")
visit namespace_project_milestone_path(project.namespace, project, milestone)
visit project_milestone_path(project, milestone)
expect(find('.alert-success')).to have_content('All issues for this milestone are closed. You may close this milestone now.')
end
......@@ -41,7 +41,7 @@ feature 'Milestone', feature: true do
scenario 'displays validation message' do
milestone = create(:milestone, project: project, title: 8.7)
visit new_namespace_project_milestone_path(project.namespace, project)
visit new_project_milestone_path(project)
page.within '.milestone-form' do
fill_in "milestone_title", with: milestone.title
end
......
......@@ -13,7 +13,7 @@ describe 'Milestone show', feature: true do
end
def visit_milestone
visit namespace_project_milestone_path(project.namespace, project, milestone)
visit project_milestone_path(project, milestone)
end
it 'avoids N+1 database queries' do
......
......@@ -29,7 +29,7 @@ feature 'Member autocomplete', :js do
context 'adding a new note on a Issue' do
let(:noteable) { create(:issue, author: author, project: project) }
before do
visit namespace_project_issue_path(project.namespace, project, noteable)
visit project_issue_path(project, noteable)
end
include_examples "open suggestions when typing @"
......@@ -42,7 +42,7 @@ feature 'Member autocomplete', :js do
target_project: project, author: author)
end
before do
visit namespace_project_merge_request_path(project.namespace, project, noteable)
visit project_merge_request_path(project, noteable)
end
include_examples "open suggestions when typing @"
......@@ -56,7 +56,7 @@ feature 'Member autocomplete', :js do
before do
allow_any_instance_of(Commit).to receive(:author).and_return(author)
visit namespace_project_commit_path(project.namespace, project, noteable)
visit project_commit_path(project, noteable)
end
include_examples "open suggestions when typing @"
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Project Activity RSS' do
let(:user) { create(:user) }
let(:project) { create(:empty_project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
let(:path) { activity_namespace_project_path(project.namespace, project) }
let(:path) { activity_project_path(project) }
before do
create(:issue, project: project)
......
......@@ -6,7 +6,7 @@ feature 'Browse artifact', :js, feature: true do
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
def browse_path(path)
browse_namespace_project_job_artifacts_path(project.namespace, project, job, path)
browse_project_job_artifacts_path(project, job, path)
end
context 'when visiting old URL' do
......
......@@ -22,7 +22,7 @@ feature 'Download artifact', :js, feature: true do
context 'via job id' do
let(:download_url) do
download_namespace_project_job_artifacts_path(project.namespace, project, job)
download_project_job_artifacts_path(project, job)
end
it_behaves_like 'downloading'
......@@ -30,7 +30,7 @@ feature 'Download artifact', :js, feature: true do
context 'via branch name and job name' do
let(:download_url) do
latest_succeeded_namespace_project_artifacts_path(project.namespace, project, "#{pipeline.ref}/download", job: job.name)
latest_succeeded_project_artifacts_path(project, "#{pipeline.ref}/download", job: job.name)
end
it_behaves_like 'downloading'
......@@ -44,7 +44,7 @@ feature 'Download artifact', :js, feature: true do
context 'via job id' do
let(:download_url) do
download_namespace_project_job_artifacts_path(project.namespace, project, job)
download_project_job_artifacts_path(project, job)
end
it_behaves_like 'downloading'
......@@ -52,7 +52,7 @@ feature 'Download artifact', :js, feature: true do
context 'via branch name and job name' do
let(:download_url) do
latest_succeeded_namespace_project_artifacts_path(project.namespace, project, "#{pipeline.ref}/download", job: job.name)
latest_succeeded_project_artifacts_path(project, "#{pipeline.ref}/download", job: job.name)
end
it_behaves_like 'downloading'
......
......@@ -10,7 +10,7 @@ feature 'Artifact file', :js, feature: true do
end
def file_path(path)
file_namespace_project_job_artifacts_path(project.namespace, project, build, path)
file_project_job_artifacts_path(project, build, path)
end
context 'Text file' do
......
......@@ -6,7 +6,7 @@ feature 'Raw artifact', :js, feature: true do
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
def raw_path(path)
raw_namespace_project_job_artifacts_path(project.namespace, project, job, path)
raw_project_job_artifacts_path(project, job, path)
end
context 'when visiting old URL' do
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment