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