Commit ee50abce authored by Robert Speicher's avatar Robert Speicher

Auto-correct ProjectPathHelper violations

parent 318d8726
...@@ -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
......
...@@ -15,7 +15,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -15,7 +15,7 @@ describe 'Board with milestone', :feature, :js do
context 'new board' do context 'new board' do
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
end end
it 'creates board with milestone' do it 'creates board with milestone' do
...@@ -35,7 +35,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -35,7 +35,7 @@ describe 'Board with milestone', :feature, :js do
let!(:board) { create(:board, project: project, milestone: milestone) } let!(:board) { create(:board, project: project, milestone: milestone) }
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
end end
it 'defaults milestone filter' do it 'defaults milestone filter' do
...@@ -100,7 +100,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -100,7 +100,7 @@ describe 'Board with milestone', :feature, :js do
let!(:list) { create(:list, board: board, label: label, position: 0) } let!(:list) { create(:list, board: board, label: label, position: 0) }
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
end end
it 'removes issues milestone when removing from the board' do it 'removes issues milestone when removing from the board' do
...@@ -122,7 +122,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -122,7 +122,7 @@ describe 'Board with milestone', :feature, :js do
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
end end
it 'creates new issue with boards milestone' do it 'creates new issue with boards milestone' do
......
...@@ -19,7 +19,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -19,7 +19,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'no lists' do context 'no lists' do
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
...@@ -83,7 +83,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -83,7 +83,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_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
...@@ -160,7 +160,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -160,7 +160,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_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
page.within(find('.board:nth-child(2)')) do page.within(find('.board:nth-child(2)')) do
...@@ -509,7 +509,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -509,7 +509,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'locked milestone' do context 'locked milestone' do
before do before do
visit namespace_project_board_path(project.namespace, project, board_with_milestone) visit project_board_path(project, board_with_milestone)
wait_for_requests wait_for_requests
end end
...@@ -525,7 +525,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -525,7 +525,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'keyboard shortcuts' do context 'keyboard shortcuts' do
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
end end
...@@ -538,7 +538,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -538,7 +538,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_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
end end
...@@ -562,7 +562,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -562,7 +562,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_boards_path(project.namespace, project) visit project_boards_path(project)
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')
......
...@@ -13,7 +13,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -13,7 +13,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
sign_in(user) sign_in(user)
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
end end
...@@ -144,7 +144,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -144,7 +144,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
context 'unauthorized user' do context 'unauthorized user' do
before do before do
visit namespace_project_boards_path(project.namespace, project) visit project_boards_path(project)
wait_for_requests wait_for_requests
end end
......
...@@ -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
......
...@@ -23,7 +23,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -23,7 +23,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
......
...@@ -88,11 +88,11 @@ feature 'CI shared runner limits', feature: true do ...@@ -88,11 +88,11 @@ feature 'CI shared runner limits', feature: true do
end end
def visit_project_home def visit_project_home
visit namespace_project_path(project.namespace, project) visit project_path(project)
end end
def visit_project_pipelines def visit_project_pipelines
visit namespace_project_pipelines_path(project.namespace, project) visit project_pipelines_path(project)
end end
def expect_quota_exceeded_alert(message = nil) def expect_quota_exceeded_alert(message = nil)
......
...@@ -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
......
...@@ -54,7 +54,7 @@ RSpec.describe 'Dashboard Projects', feature: true do ...@@ -54,7 +54,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
...@@ -347,7 +347,7 @@ feature 'Dashboard Todos' do ...@@ -347,7 +347,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
......
...@@ -28,7 +28,7 @@ describe 'Related issues', feature: true, js: true do ...@@ -28,7 +28,7 @@ describe 'Related issues', feature: true, js: true do
context 'visiting issue_a' do context 'visiting issue_a' do
before do before do
visit namespace_project_issue_path(project.namespace, project, issue_a) visit project_issue_path(project, issue_a)
wait_for_requests wait_for_requests
end end
...@@ -43,7 +43,7 @@ describe 'Related issues', feature: true, js: true do ...@@ -43,7 +43,7 @@ describe 'Related issues', feature: true, js: true do
context 'visiting issue_b which was targeted by issue_a' do context 'visiting issue_b which was targeted by issue_a' do
before do before do
visit namespace_project_issue_path(project.namespace, project, issue_b) visit project_issue_path(project, issue_b)
wait_for_requests wait_for_requests
end end
...@@ -67,7 +67,7 @@ describe 'Related issues', feature: true, js: true do ...@@ -67,7 +67,7 @@ describe 'Related issues', feature: true, js: true do
let!(:issue_link_c) { create :issue_link, source: issue_a, target: issue_c } let!(:issue_link_c) { create :issue_link, source: issue_a, target: issue_c }
before do before do
visit namespace_project_issue_path(project.namespace, project, issue_a) visit project_issue_path(project, issue_a)
wait_for_requests wait_for_requests
end end
...@@ -83,7 +83,7 @@ describe 'Related issues', feature: true, js: true do ...@@ -83,7 +83,7 @@ describe 'Related issues', feature: true, js: true do
context 'without existing related issues' do context 'without existing related issues' do
before do before do
visit namespace_project_issue_path(project.namespace, project, issue_a) visit project_issue_path(project, issue_a)
wait_for_requests wait_for_requests
end end
...@@ -132,7 +132,7 @@ describe 'Related issues', feature: true, js: true do ...@@ -132,7 +132,7 @@ describe 'Related issues', feature: true, js: true do
let!(:issue_link_c) { create :issue_link, source: issue_a, target: issue_c } let!(:issue_link_c) { create :issue_link, source: issue_a, target: issue_c }
before do before do
visit namespace_project_issue_path(project.namespace, project, issue_a) visit project_issue_path(project, issue_a)
wait_for_requests wait_for_requests
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
......
...@@ -13,7 +13,7 @@ describe 'Issues csv', feature: true do ...@@ -13,7 +13,7 @@ describe 'Issues csv', feature: true do
end end
def request_csv(params = {}) def request_csv(params = {})
visit namespace_project_issues_path(project.namespace, project, params) visit project_issues_path(project, params)
click_on 'Export as CSV' click_on 'Export as CSV'
click_on 'Export issues' click_on 'Export issues'
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
......
...@@ -29,7 +29,7 @@ describe 'Dropdown weight', js: true, feature: true do ...@@ -29,7 +29,7 @@ describe 'Dropdown weight', 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
......
...@@ -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
......
...@@ -33,7 +33,7 @@ describe 'Filter issues weight', js: true, feature: true do ...@@ -33,7 +33,7 @@ describe 'Filter issues weight', js: true, feature: true do
assignees: [user]) assignees: [user])
issue.labels << label issue.labels << label
visit namespace_project_issues_path(project.namespace, project) visit project_issues_path(project)
end end
describe 'only weight' do describe 'only weight' 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 (EE)', :feature, :js do ...@@ -21,7 +21,7 @@ describe 'New/edit issue (EE)', :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 (EE)', :feature, :js do ...@@ -39,7 +39,7 @@ describe 'New/edit issue (EE)', :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'
......
...@@ -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
xdescribe 'shorten users API pagination limit (CE)' do xdescribe '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'
...@@ -239,7 +239,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -239,7 +239,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
...@@ -300,7 +300,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -300,7 +300,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')
......
...@@ -209,7 +209,7 @@ feature 'Issue Sidebar', feature: true do ...@@ -209,7 +209,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 @@ describe 'Issues sub nav EE', :feature do ...@@ -8,7 +8,7 @@ describe 'Issues sub nav EE', :feature do
project.add_master(user) project.add_master(user)
sign_in(user) sign_in(user)
visit namespace_project_issues_path(project.namespace, project) visit project_issues_path(project)
end end
it 'should have a `Boards` item' do it 'should have a `Boards` item' 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'
...@@ -157,7 +157,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do ...@@ -157,7 +157,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 'creates a note, and does not set the weight' do it 'creates a note, and does not set the weight' do
...@@ -195,7 +195,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do ...@@ -195,7 +195,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 'creates a note, and does not set the weight' do it 'creates a note, and does not set the weight' do
......
This diff is collapsed.
...@@ -13,7 +13,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -13,7 +13,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(author) project.add_developer(author)
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)
find('#s2id_merge_request_approver_ids .select2-input').click find('#s2id_merge_request_approver_ids .select2-input').click
end end
...@@ -40,7 +40,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -40,7 +40,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(other_user) project.add_developer(other_user)
sign_in(user) sign_in(user)
visit namespace_project_new_merge_request_path(forked_project.namespace, forked_project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit project_new_merge_request_path(forked_project, merge_request: { target_branch: 'master', source_branch: 'feature' })
find('#s2id_merge_request_approver_ids .select2-input').click find('#s2id_merge_request_approver_ids .select2-input').click
end end
...@@ -73,7 +73,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -73,7 +73,7 @@ feature 'Merge request approvals', js: true, feature: true do
group = create :group group = create :group
group.add_developer(other_user) group.add_developer(other_user)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature' })
find('#s2id_merge_request_approver_group_ids .select2-input').click find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_requests wait_for_requests
...@@ -95,7 +95,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -95,7 +95,7 @@ feature 'Merge request approvals', js: true, feature: true do
create :approver_group, group: group, target: project create :approver_group, group: group, target: project
create :approver, user: approver, target: project create :approver, user: approver, target: project
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature' })
within('.approver-list li.approver-group') do within('.approver-list li.approver-group') do
click_on "Remove" click_on "Remove"
...@@ -128,7 +128,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -128,7 +128,7 @@ feature 'Merge request approvals', js: true, feature: true do
group.add_developer(other_user) group.add_developer(other_user)
group.add_developer(user) group.add_developer(user)
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request) visit edit_project_merge_request_path(project, merge_request)
find('#s2id_merge_request_approver_group_ids .select2-input').click find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_requests wait_for_requests
...@@ -150,7 +150,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -150,7 +150,7 @@ feature 'Merge request approvals', js: true, feature: true do
create :approver_group, group: group, target: project create :approver_group, group: group, target: project
create :approver, user: approver, target: project create :approver, user: approver, target: project
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request) visit edit_project_merge_request_path(project, merge_request)
within('.approver-list li.approver-group') do within('.approver-list li.approver-group') do
click_on "Remove" click_on "Remove"
...@@ -168,7 +168,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -168,7 +168,7 @@ feature 'Merge request approvals', js: true, feature: true do
it 'allows changing approvals number' do it 'allows changing approvals number' do
create_list :approver, 3, target: project create_list :approver, 3, target: project
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit project_merge_request_path(project, merge_request)
# project setting in the beginning on the show MR page # project setting in the beginning on the show MR page
find('.approvals-components') find('.approvals-components')
...@@ -213,7 +213,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -213,7 +213,7 @@ feature 'Merge request approvals', js: true, feature: true do
context 'when group is assigned to a project', js: true do context 'when group is assigned to a project', js: true do
before do before do
create :approver_group, group: group, target: project create :approver_group, group: group, target: project
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it 'I am able to approve' do it 'I am able to approve' do
...@@ -232,7 +232,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -232,7 +232,7 @@ feature 'Merge request approvals', js: true, feature: true do
context 'when group is assigned to a merge request', js: true do context 'when group is assigned to a merge request', js: true do
before do before do
create :approver_group, group: group, target: merge_request create :approver_group, group: group, target: merge_request
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it 'I am able to approve' do it 'I am able to approve' do
...@@ -254,7 +254,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -254,7 +254,7 @@ feature 'Merge request approvals', js: true, feature: true do
create :approver_group, group: group, target: merge_request create :approver_group, group: group, target: merge_request
pipeline = create(:ci_empty_pipeline, project: project, sha: merge_request.diff_head_sha, ref: merge_request.source_branch) pipeline = create(:ci_empty_pipeline, project: project, sha: merge_request.diff_head_sha, ref: merge_request.source_branch)
merge_request.update(head_pipeline: pipeline) merge_request.update(head_pipeline: pipeline)
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit project_merge_request_path(project, merge_request)
end end
it 'I am unable to set Merge when pipeline succeeds' do it 'I am unable to set Merge when pipeline succeeds' do
...@@ -280,7 +280,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -280,7 +280,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(user) project.add_developer(user)
sign_in(user) sign_in(user)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature' })
click_button 'Submit merge request' click_button 'Submit merge request'
end end
......
...@@ -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')
...@@ -63,7 +63,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -63,7 +63,7 @@ feature 'Create New Merge Request', feature: true, js: true do
context 'when approvals are disabled for the target project' do context 'when approvals are disabled for the target project' do
it 'does not show approval settings' do it 'does not show approval settings' do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature_conflict' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature_conflict' })
expect(page).not_to have_content('Approvers') expect(page).not_to have_content('Approvers')
end end
...@@ -73,7 +73,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -73,7 +73,7 @@ feature 'Create New Merge Request', feature: true, js: true do
before do before do
project.update_attributes(approvals_before_merge: 1) project.update_attributes(approvals_before_merge: 1)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature_conflict' }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: 'feature_conflict' })
end end
it 'shows approval settings' do it 'shows approval settings' do
...@@ -94,7 +94,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -94,7 +94,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
...@@ -105,7 +105,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -105,7 +105,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
...@@ -113,13 +113,13 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -113,13 +113,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'
...@@ -135,7 +135,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -135,7 +135,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')
...@@ -144,7 +144,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -144,7 +144,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"
...@@ -154,7 +154,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -154,7 +154,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
...@@ -167,9 +167,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -167,9 +167,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
......
...@@ -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'
...@@ -88,6 +88,6 @@ feature 'Edit Merge Request', feature: true do ...@@ -88,6 +88,6 @@ feature 'Edit Merge Request', feature: true do
def visit_edit_mr_page def visit_edit_mr_page
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
end end
...@@ -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
...@@ -40,6 +40,6 @@ feature 'Merge With Push Rules Validation', feature: true, js: true do ...@@ -40,6 +40,6 @@ feature 'Merge With Push Rules Validation', feature: true, js: true 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
......
...@@ -55,7 +55,7 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -55,7 +55,7 @@ feature 'Squashing merge requests', js: true, feature: true do
before do before do
merge_request = create(:merge_request, source_project: project, target_project: project, source_branch: 'master', target_branch: 'branch-merged') merge_request = create(:merge_request, source_project: project, target_project: project, source_branch: 'master', target_branch: 'branch-merged')
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 the squash checkbox' do it 'does not show the squash checkbox' do
...@@ -65,7 +65,7 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -65,7 +65,7 @@ feature 'Squashing merge requests', js: true, feature: true do
context 'when squash is enabled on merge request creation' do context 'when squash is enabled on merge request creation' do
before do before do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch })
check 'merge_request[squash]' check 'merge_request[squash]'
click_on 'Submit merge request' click_on 'Submit merge request'
wait_for_requests wait_for_requests
...@@ -95,7 +95,7 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -95,7 +95,7 @@ feature 'Squashing merge requests', js: true, feature: true do
context 'when squash is not enabled on merge request creation' do context 'when squash is not enabled on merge request creation' do
before do before do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch })
click_on 'Submit merge request' click_on 'Submit merge request'
wait_for_requests wait_for_requests
end end
...@@ -130,13 +130,13 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -130,13 +130,13 @@ feature 'Squashing merge requests', js: true, feature: true do
end end
it 'does not show squash option when creating MR' do it 'does not show squash option when creating MR' do
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch })
expect(page).to have_no_field('merge_request[squash]') expect(page).to have_no_field('merge_request[squash]')
end end
it 'does not show squash option when viewing MR' do it 'does not show squash option when viewing MR' do
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit project_merge_request_path(project, merge_request)
expect(page).to have_no_field('squash') expect(page).to have_no_field('squash')
end end
......
...@@ -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
......
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.
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