Skip to content
Snippets Groups Projects
Commit 9eeba8fb authored by Robert Speicher's avatar Robert Speicher
Browse files

Auto-correct ProjectPathHelper violations

parent ea2a91a3
No related branches found
No related tags found
No related merge requests found
Showing
with 47 additions and 51 deletions
Loading
Loading
@@ -51,7 +51,7 @@ feature 'Admin disables Git access protocol', feature: true do
end
 
def visit_project
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
 
def disable_http_protocol
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ describe "Admin::Projects", feature: true do
end
 
it do
expect(current_path).to eq admin_namespace_project_path(project.namespace, project)
expect(current_path).to eq admin_project_path(project)
end
 
it "has project info" do
Loading
Loading
@@ -64,7 +64,7 @@ describe "Admin::Projects", feature: true do
end
 
it 'transfers project to group web', js: true do
visit admin_namespace_project_path(project.namespace, project)
visit admin_project_path(project)
 
click_button 'Search for Namespace'
click_link 'group: web'
Loading
Loading
@@ -81,7 +81,7 @@ describe "Admin::Projects", feature: true do
end
 
it 'adds admin a to a project as developer', js: true do
visit namespace_project_project_members_path(project.namespace, project)
visit project_project_members_path(project)
 
page.within '.users-project-form' do
select2(current_user.id, from: '#user_ids', multiple: true)
Loading
Loading
@@ -104,7 +104,7 @@ describe "Admin::Projects", feature: true do
end
 
it 'removes admin from the project' do
visit namespace_project_project_members_path(project.namespace, project)
visit project_project_members_path(project)
 
page.within '.content-list' do
expect(page).to have_content(current_user.name)
Loading
Loading
Loading
Loading
@@ -43,6 +43,6 @@ feature 'Admin uses repository checks', feature: true do
end
 
def visit_admin_project_page(project)
visit admin_namespace_project_path(project.namespace, project)
visit admin_project_path(project)
end
end
Loading
Loading
@@ -16,7 +16,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated' do
it 'renders atom feed' do
sign_in user
visit namespace_project_issues_path(project.namespace, project, :atom)
visit project_issues_path(project, :atom)
 
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
Loading
Loading
@@ -30,8 +30,7 @@ describe 'Issues Feed', feature: true do
 
context 'when authenticated via private token' do
it 'renders atom feed' do
visit namespace_project_issues_path(project.namespace, project, :atom,
private_token: user.private_token)
visit project_issues_path(project, :atom, private_token: user.private_token)
 
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
Loading
Loading
@@ -45,8 +44,7 @@ describe 'Issues Feed', feature: true do
 
context 'when authenticated via RSS token' do
it 'renders atom feed' do
visit namespace_project_issues_path(project.namespace, project, :atom,
rss_token: user.rss_token)
visit project_issues_path(project, :atom, rss_token: user.rss_token)
 
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
Loading
Loading
@@ -59,8 +57,7 @@ describe 'Issues Feed', feature: true do
end
 
it "renders atom feed with url parameters for project issues" do
visit namespace_project_issues_path(project.namespace, project,
:atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
visit project_issues_path(project, :atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
 
link = find('link[type="application/atom+xml"]')
params = CGI.parse(URI.parse(link[:href]).query)
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe 'Auto deploy' do
end
 
it 'does not show a button to set up auto deploy' do
visit namespace_project_path(project.namespace, project)
visit project_path(project)
expect(page).to have_no_content('Set up auto deploy')
end
end
Loading
Loading
@@ -24,7 +24,7 @@ describe 'Auto deploy' do
context 'when a deployment service is active' do
before do
project.kubernetes_service.update!(active: true)
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
 
it 'shows a button to set up auto deploy' do
Loading
Loading
Loading
Loading
@@ -16,12 +16,12 @@ describe 'Issue Boards add issue modal', :feature, :js do
 
sign_in(user)
 
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
it 'resets filtered search state' do
visit namespace_project_board_path(project.namespace, project, board, search: 'testing')
visit project_board_path(project, board, search: 'testing')
 
wait_for_requests
 
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@ describe 'Issue Boards', feature: true, js: true do
 
context 'no lists' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
end
Loading
Loading
@@ -81,7 +81,7 @@ describe 'Issue Boards', feature: true, js: true do
let!(:issue9) { create(:labeled_issue, project: project, labels: [planning, testing, bug, accepting], relative_position: 1) }
 
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
 
wait_for_requests
 
Loading
Loading
@@ -158,7 +158,7 @@ describe 'Issue Boards', feature: true, js: true do
create(:labeled_issue, project: project, labels: [planning])
end
 
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
page.within(find('.board:nth-child(2)')) do
Loading
Loading
@@ -507,7 +507,7 @@ describe 'Issue Boards', feature: true, js: true do
 
context 'keyboard shortcuts' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
@@ -520,7 +520,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
sign_out(:user)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
@@ -544,7 +544,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user_guest, :guest]
sign_out(:user)
sign_in(user_guest)
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe 'Issue Boards', :feature, :js do
let!(:issue4) { create(:labeled_issue, project: project, labels: [label]) }
 
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
expect(page).to have_selector('.board', count: 3)
Loading
Loading
@@ -47,7 +47,7 @@ describe 'Issue Boards', :feature, :js do
 
context 'ordering in list' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
expect(page).to have_selector('.board', count: 3)
Loading
Loading
@@ -110,7 +110,7 @@ describe 'Issue Boards', :feature, :js do
let!(:issue6) { create(:labeled_issue, project: project, title: 'testing 3', labels: [label2], relative_position: 1.0) }
 
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
expect(page).to have_selector('.board', count: 4)
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
 
sign_in(create(:admin))
 
visit namespace_project_path(project.namespace, project)
visit project_path(project)
end
 
it 'takes user to issue board index' do
Loading
Loading
Loading
Loading
@@ -202,7 +202,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
end
 
def visit_board
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
click_button('Add issues')
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
 
sign_in(user)
 
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
 
expect(page).to have_selector('.board', count: 3)
Loading
Loading
@@ -83,7 +83,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
 
context 'unauthorized user' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe 'Issue Boards', feature: true, js: true do
 
sign_in(user)
 
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@ describe 'Sub-group project issue boards', :feature, :js do
 
sign_in(user)
 
visit namespace_project_board_path(project.namespace, project, board)
visit project_board_path(project, board)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -66,7 +66,7 @@ describe 'Commits' do
end
 
before do
visit namespace_project_commits_path(project.namespace, project, :master)
visit project_commits_path(project, :master)
end
 
it 'shows correct build status from default branch' do
Loading
Loading
@@ -192,7 +192,7 @@ describe 'Commits' do
before do
project.team << [user, :master]
sign_in(user)
visit namespace_project_commits_path(project.namespace, project, branch_name)
visit project_commits_path(project, branch_name)
end
 
it 'includes the committed_date for each commit' do
Loading
Loading
Loading
Loading
@@ -55,7 +55,6 @@ describe "Container Registry" do
end
 
def visit_container_registry
visit namespace_project_container_registry_index_path(
project.namespace, project)
visit project_container_registry_index_path(project)
end
end
Loading
Loading
@@ -16,7 +16,7 @@ describe 'Copy as GFM', feature: true, js: true do
# `markdown` helper expects a `@project` variable
@project = @feat.project
 
visit namespace_project_issue_path(@project.namespace, @project, @feat.issue)
visit project_issue_path(@project, @feat.issue)
end
 
# The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert GitLab Flavored Markdown (GFM) to HTML.
Loading
Loading
@@ -121,13 +121,13 @@ describe 'Copy as GFM', feature: true, js: true do
# full issue reference
@feat.issue.to_reference(full: true),
# issue URL
namespace_project_issue_url(@project.namespace, @project, @feat.issue),
project_issue_url(@project, @feat.issue),
# issue URL with note anchor
namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123'),
project_issue_url(@project, @feat.issue, anchor: 'note_123'),
# issue link
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue)})",
"[Issue](#{project_issue_url(@project, @feat.issue)})",
# issue link with note anchor
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123')})"
"[Issue](#{project_issue_url(@project, @feat.issue, anchor: 'note_123')})"
)
 
verify(
Loading
Loading
@@ -466,7 +466,7 @@ describe 'Copy as GFM', feature: true, js: true do
 
context 'from a diff' do
before do
visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
visit project_commit_path(project, sample_commit.id)
end
 
context 'selecting one word of text' do
Loading
Loading
@@ -507,7 +507,7 @@ describe 'Copy as GFM', feature: true, js: true do
 
context 'from a blob' do
before do
visit namespace_project_blob_path(project.namespace, project, File.join('master', 'files/ruby/popen.rb'))
visit project_blob_path(project, File.join('master', 'files/ruby/popen.rb'))
wait_for_requests
end
 
Loading
Loading
@@ -549,7 +549,7 @@ describe 'Copy as GFM', feature: true, js: true do
 
context 'from a GFM code block' do
before do
visit namespace_project_blob_path(project.namespace, project, File.join('markdown', 'doc/api/users.md'))
visit project_blob_path(project, File.join('markdown', 'doc/api/users.md'))
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ feature 'Cycle Analytics', feature: true, js: true do
 
sign_in(user)
 
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
 
Loading
Loading
@@ -39,7 +39,7 @@ feature 'Cycle Analytics', feature: true, js: true do
deploy_master
 
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
end
 
it 'shows data on each stage' do
Loading
Loading
@@ -71,7 +71,7 @@ feature 'Cycle Analytics', feature: true, js: true do
 
project.team << [user, :master]
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
 
Loading
Loading
@@ -94,7 +94,7 @@ feature 'Cycle Analytics', feature: true, js: true do
deploy_master
 
sign_in(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project)
visit project_cycle_analytics_path(project)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ feature 'Project member activity', feature: true, js: true do
 
def visit_activities_and_wait_with_event(event_type)
Event.create(project: project, author_id: user.id, action: event_type)
visit activity_namespace_project_path(project.namespace, project)
visit activity_project_path(project)
wait_for_requests
end
 
Loading
Loading
Loading
Loading
@@ -66,7 +66,7 @@ RSpec.describe 'Dashboard Projects', feature: true do
it 'shows that the last pipeline passed' do
visit dashboard_projects_path
 
expect(page).to have_xpath("//a[@href='#{pipelines_namespace_project_commit_path(project.namespace, project, project.commit)}']")
expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit)}']")
end
end
end
Loading
Loading
@@ -330,7 +330,7 @@ feature 'Dashboard Todos' do
end
 
it 'links to the pipelines for the merge request' do
href = pipelines_namespace_project_merge_request_path(project.namespace, project, todo.target)
href = pipelines_project_merge_request_path(project, todo.target)
 
expect(page).to have_link "merge request #{todo.target.to_reference(full: true)}", href
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment