diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-07-06 19:20:50 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-07-06 19:20:50 +0300 |
commit | 9eeba8fb49c5da7cf0b2c22bc33cbd33a83918ed (patch) | |
tree | 74edd22b27623fc2bd0537be534355a4ce0fdc73 /spec/features/projects/blobs | |
parent | ea2a91a36ef94e7e360056b0569377c6fe51491b (diff) |
Auto-correct ProjectPathHelper violations
Diffstat (limited to 'spec/features/projects/blobs')
4 files changed, 24 insertions, 24 deletions
diff --git a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb index d94204230f6..7564338b301 100644 --- a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb +++ b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb @@ -13,14 +13,14 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, end def visit_blob(fragment = nil) - visit namespace_project_blob_path(project.namespace, project, tree_join('master', path), anchor: fragment) + visit project_blob_path(project, tree_join('master', path), anchor: fragment) end describe 'Click "Permalink" button' do it 'works with no initial line number fragment hash' do visit_blob - expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path)))) + expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(project_blob_path(project, tree_join(sha, path)))) end it 'maintains intitial fragment hash' do @@ -28,7 +28,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, visit_blob(fragment) - expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path), anchor: fragment))) + expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(project_blob_path(project, tree_join(sha, path), anchor: fragment))) end it 'changes fragment hash if line number clicked' do @@ -39,7 +39,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, find('#L3').click find("##{ending_fragment}").click - expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path), anchor: ending_fragment))) + expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(project_blob_path(project, tree_join(sha, path), anchor: ending_fragment))) end it 'with initial fragment hash, changes fragment hash if line number clicked' do @@ -51,7 +51,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, find('#L3').click find("##{ending_fragment}").click - expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path), anchor: ending_fragment))) + expect(find('.js-data-file-blob-permalink-url')['href']).to eq(get_absolute_url(project_blob_path(project, tree_join(sha, path), anchor: ending_fragment))) end end @@ -59,7 +59,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, it 'works with no initial line number fragment hash' do visit_blob - expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(namespace_project_blame_path(project.namespace, project, tree_join('master', path)))) + expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(project_blame_path(project, tree_join('master', path)))) end it 'maintains intitial fragment hash' do @@ -67,7 +67,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, visit_blob(fragment) - expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(namespace_project_blame_path(project.namespace, project, tree_join('master', path), anchor: fragment))) + expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(project_blame_path(project, tree_join('master', path), anchor: fragment))) end it 'changes fragment hash if line number clicked' do @@ -78,7 +78,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, find('#L3').click find("##{ending_fragment}").click - expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(namespace_project_blame_path(project.namespace, project, tree_join('master', path), anchor: ending_fragment))) + expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(project_blame_path(project, tree_join('master', path), anchor: ending_fragment))) end it 'with initial fragment hash, changes fragment hash if line number clicked' do @@ -90,7 +90,7 @@ feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', feature: true, find('#L3').click find("##{ending_fragment}").click - expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(namespace_project_blame_path(project.namespace, project, tree_join('master', path), anchor: ending_fragment))) + expect(find('.js-blob-blame-link')['href']).to eq(get_absolute_url(project_blame_path(project, tree_join('master', path), anchor: ending_fragment))) end end end diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb index 71ffa352f80..3427f639930 100644 --- a/spec/features/projects/blobs/blob_show_spec.rb +++ b/spec/features/projects/blobs/blob_show_spec.rb @@ -4,7 +4,7 @@ feature 'File blob', :js, feature: true do let(:project) { create(:project, :public) } def visit_blob(path, anchor: nil, ref: 'master') - visit namespace_project_blob_path(project.namespace, project, File.join(ref, path), anchor: anchor) + visit project_blob_path(project, File.join(ref, path), anchor: anchor) wait_for_requests end diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index c6061f220c4..c9384a09ccd 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -26,7 +26,7 @@ feature 'Editing file blob', feature: true, js: true do context 'from MR diff' do before do - visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) + visit diffs_project_merge_request_path(project, merge_request) edit_and_commit end @@ -37,7 +37,7 @@ feature 'Editing file blob', feature: true, js: true do context 'from blob file path' do before do - visit namespace_project_blob_path(project.namespace, project, tree_join(branch, file_path)) + visit project_blob_path(project, tree_join(branch, file_path)) edit_and_commit end @@ -55,7 +55,7 @@ feature 'Editing file blob', feature: true, js: true do before do project.team << [user, :developer] - visit namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path)) + visit project_edit_blob_path(project, tree_join(branch, file_path)) end it 'redirects to sign in and returns' do @@ -63,7 +63,7 @@ feature 'Editing file blob', feature: true, js: true do gitlab_sign_in(user) - expect(page).to have_current_path(namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path))) + expect(page).to have_current_path(project_edit_blob_path(project, tree_join(branch, file_path))) end end @@ -71,7 +71,7 @@ feature 'Editing file blob', feature: true, js: true do let(:user) { create(:user) } before do - visit namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path)) + visit project_edit_blob_path(project, tree_join(branch, file_path)) end it 'redirects to sign in and returns' do @@ -79,7 +79,7 @@ feature 'Editing file blob', feature: true, js: true do gitlab_sign_in(user) - expect(page).to have_current_path(namespace_project_blob_path(project.namespace, project, tree_join(branch, file_path))) + expect(page).to have_current_path(project_blob_path(project, tree_join(branch, file_path))) end end end @@ -97,18 +97,18 @@ feature 'Editing file blob', feature: true, js: true do context 'on some branch' do before do - visit namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path)) + visit project_edit_blob_path(project, tree_join(branch, file_path)) end it 'shows blob editor with same branch' do - expect(page).to have_current_path(namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path))) + expect(page).to have_current_path(project_edit_blob_path(project, tree_join(branch, file_path))) expect(find('.js-branch-name').value).to eq(branch) end end context 'with protected branch' do before do - visit namespace_project_edit_blob_path(project.namespace, project, tree_join(protected_branch, file_path)) + visit project_edit_blob_path(project, tree_join(protected_branch, file_path)) end it 'shows blob editor with patch branch' do @@ -123,11 +123,11 @@ feature 'Editing file blob', feature: true, js: true do before do project.team << [user, :master] sign_in(user) - visit namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path)) + visit project_edit_blob_path(project, tree_join(branch, file_path)) end it 'shows blob editor with same branch' do - expect(page).to have_current_path(namespace_project_edit_blob_path(project.namespace, project, tree_join(branch, file_path))) + expect(page).to have_current_path(project_edit_blob_path(project, tree_join(branch, file_path))) expect(find('.js-branch-name').value).to eq(branch) end end diff --git a/spec/features/projects/blobs/shortcuts_blob_spec.rb b/spec/features/projects/blobs/shortcuts_blob_spec.rb index 30e2d587267..9cacda84378 100644 --- a/spec/features/projects/blobs/shortcuts_blob_spec.rb +++ b/spec/features/projects/blobs/shortcuts_blob_spec.rb @@ -12,7 +12,7 @@ feature 'Blob shortcuts', feature: true do end def visit_blob(fragment = nil) - visit namespace_project_blob_path(project.namespace, project, tree_join('master', path), anchor: fragment) + visit project_blob_path(project, tree_join('master', path), anchor: fragment) end describe 'pressing "y"' do @@ -21,7 +21,7 @@ feature 'Blob shortcuts', feature: true do find('body').native.send_key('y') - expect(page).to have_current_path(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path))), url: true) + expect(page).to have_current_path(get_absolute_url(project_blob_path(project, tree_join(sha, path))), url: true) end it 'maintains fragment hash when redirecting' do @@ -30,7 +30,7 @@ feature 'Blob shortcuts', feature: true do find('body').native.send_key('y') - expect(page).to have_current_path(get_absolute_url(namespace_project_blob_path(project.namespace, project, tree_join(sha, path), anchor: fragment)), url: true) + expect(page).to have_current_path(get_absolute_url(project_blob_path(project, tree_join(sha, path), anchor: fragment)), url: true) end end end |