diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-29 20:06:35 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-07-05 19:11:59 +0300 |
commit | fe13f110412d85c05dc68e5ee1db499f681bf722 (patch) | |
tree | 4a2d172bb5a490ac8cadbcf376fbf815393ef22b /spec/features/projects/files | |
parent | dc7939337e0d72d2391c3bbb3082d644a54195af (diff) |
Create and use project path helpers that only need a project, no namespace
Diffstat (limited to 'spec/features/projects/files')
15 files changed, 28 insertions, 38 deletions
diff --git a/spec/features/projects/files/browse_files_spec.rb b/spec/features/projects/files/browse_files_spec.rb index 34aef958ec6..ac2b926f4de 100644 --- a/spec/features/projects/files/browse_files_spec.rb +++ b/spec/features/projects/files/browse_files_spec.rb @@ -7,7 +7,7 @@ feature 'user browses project', feature: true, js: true do before do project.team << [user, :master] gitlab_sign_in(user) - visit namespace_project_tree_path(project.namespace, project, project.default_branch) + visit project_tree_path(project, project.default_branch) end scenario "can see blame of '.gitignore'" do diff --git a/spec/features/projects/files/creating_a_file_spec.rb b/spec/features/projects/files/creating_a_file_spec.rb index 2a1cc01fe68..c31056c3ff7 100644 --- a/spec/features/projects/files/creating_a_file_spec.rb +++ b/spec/features/projects/files/creating_a_file_spec.rb @@ -7,7 +7,7 @@ feature 'User wants to create a file', feature: true do background do project.team << [user, :master] gitlab_sign_in user - visit namespace_project_new_blob_path(project.namespace, project, project.default_branch) + visit project_new_blob_path(project, project.default_branch) end def submit_new_file(options) diff --git a/spec/features/projects/files/dockerfile_dropdown_spec.rb b/spec/features/projects/files/dockerfile_dropdown_spec.rb index 4f1b8588462..783d98dafa7 100644 --- a/spec/features/projects/files/dockerfile_dropdown_spec.rb +++ b/spec/features/projects/files/dockerfile_dropdown_spec.rb @@ -9,7 +9,7 @@ feature 'User wants to add a Dockerfile file', feature: true do gitlab_sign_in user - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: 'Dockerfile') + visit project_new_blob_path(project, 'master', file_name: 'Dockerfile') end scenario 'user can see Dockerfile dropdown' do diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb index 60182bfebe9..4f4fab8a6e5 100644 --- a/spec/features/projects/files/download_buttons_spec.rb +++ b/spec/features/projects/files/download_buttons_spec.rb @@ -29,14 +29,11 @@ feature 'Download buttons in files tree', feature: true do describe 'when files tree' do context 'with artifacts' do before do - visit namespace_project_tree_path( - project.namespace, project, project.default_branch) + visit project_tree_path(project, project.default_branch) end scenario 'shows download artifacts button' do - href = latest_succeeded_namespace_project_artifacts_path( - project.namespace, project, "#{project.default_branch}/download", - job: 'build') + href = latest_succeeded_project_artifacts_path(project, "#{project.default_branch}/download", job: 'build') expect(page).to have_link "Download '#{build.name}'", href: href end diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb index 6e361ac4312..83aea070901 100644 --- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb +++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb @@ -6,7 +6,7 @@ feature 'User uses soft wrap whilst editing file', feature: true, js: true do project = create(:project) project.team << [user, :master] gitlab_sign_in user - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: 'test_file-name') + visit project_new_blob_path(project, 'master', file_name: 'test_file-name') editor = find('.file-editor.code') editor.click editor.send_keys 'Touch water with paw then recoil in horror chase dog then diff --git a/spec/features/projects/files/editing_a_file_spec.rb b/spec/features/projects/files/editing_a_file_spec.rb index e97ff5fded7..c9b0dbd0ffb 100644 --- a/spec/features/projects/files/editing_a_file_spec.rb +++ b/spec/features/projects/files/editing_a_file_spec.rb @@ -18,7 +18,7 @@ feature 'User wants to edit a file', feature: true do background do project.team << [user, :master] gitlab_sign_in user - visit namespace_project_edit_blob_path(project.namespace, project, + visit project_edit_blob_path(project, File.join(project.default_branch, '.gitignore')) end diff --git a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb index 83a837fba44..07b4aa80f4b 100644 --- a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb +++ b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb @@ -7,7 +7,7 @@ feature 'User views files page', feature: true do before do project.team << [user, :master] gitlab_sign_in user - visit namespace_project_tree_path(project.namespace, project, project.repository.root_ref) + visit project_tree_path(project, project.repository.root_ref) end scenario 'user sees folders and submodules sorted together, followed by files' do diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb index 6a914820ac9..087eef5d407 100644 --- a/spec/features/projects/files/find_file_keyboard_spec.rb +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -8,7 +8,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do project.team << [user, :master] gitlab_sign_in user - visit namespace_project_find_file_path(project.namespace, project, project.repository.root_ref) + visit project_find_file_path(project, project.repository.root_ref) wait_for_requests end diff --git a/spec/features/projects/files/find_files_spec.rb b/spec/features/projects/files/find_files_spec.rb index 166ec5c921b..d2ccc9a0732 100644 --- a/spec/features/projects/files/find_files_spec.rb +++ b/spec/features/projects/files/find_files_spec.rb @@ -10,20 +10,13 @@ feature 'Find files button in the tree header', feature: true do end scenario 'project main screen' do - visit namespace_project_path( - project.namespace, - project - ) + visit project_path(project) expect(page).to have_selector('.tree-controls .shortcuts-find-file') end scenario 'project tree screen' do - visit namespace_project_tree_path( - project.namespace, - project, - project.default_branch - ) + visit project_tree_path(project, project.default_branch) expect(page).to have_selector('.tree-controls .shortcuts-find-file') end diff --git a/spec/features/projects/files/gitignore_dropdown_spec.rb b/spec/features/projects/files/gitignore_dropdown_spec.rb index 7f02ec6b73d..23c145d0a11 100644 --- a/spec/features/projects/files/gitignore_dropdown_spec.rb +++ b/spec/features/projects/files/gitignore_dropdown_spec.rb @@ -6,7 +6,7 @@ feature 'User wants to add a .gitignore file', feature: true do project = create(:project) project.team << [user, :master] gitlab_sign_in user - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: '.gitignore') + visit project_new_blob_path(project, 'master', file_name: '.gitignore') end scenario 'user can see .gitignore dropdown' do diff --git a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb index f4b17c2518c..0539b77e3dd 100644 --- a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb +++ b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb @@ -6,7 +6,7 @@ feature 'User wants to add a .gitlab-ci.yml file', feature: true do project = create(:project) project.team << [user, :master] gitlab_sign_in user - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: '.gitlab-ci.yml') + visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml') end scenario 'user can see .gitlab-ci.yml dropdown' do diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index 7daf016dd22..3a4ed3d8cf0 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -8,11 +8,11 @@ feature 'project owner creates a license file', feature: true, js: true do message: 'Remove LICENSE', branch_name: 'master') project.team << [project_master, :master] gitlab_sign_in(project_master) - visit namespace_project_path(project.namespace, project) + visit project_path(project) end scenario 'project master creates a license file manually from a template' do - visit namespace_project_tree_path(project.namespace, project, project.repository.root_ref) + visit project_tree_path(project, project.repository.root_ref) find('.add-to-tree').click click_link 'New file' @@ -30,7 +30,7 @@ feature 'project owner creates a license file', feature: true, js: true do click_button 'Commit changes' expect(current_path).to eq( - namespace_project_blob_path(project.namespace, project, 'master/LICENSE')) + project_blob_path(project, 'master/LICENSE')) expect(page).to have_content('MIT License') expect(page).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") end @@ -40,7 +40,7 @@ feature 'project owner creates a license file', feature: true, js: true do expect(page).to have_content('New file') expect(current_path).to eq( - namespace_project_new_blob_path(project.namespace, project, 'master')) + project_new_blob_path(project, 'master')) expect(find('#file_name').value).to eq('LICENSE') expect(page).to have_selector('.license-selector') @@ -54,7 +54,7 @@ feature 'project owner creates a license file', feature: true, js: true do click_button 'Commit changes' expect(current_path).to eq( - namespace_project_blob_path(project.namespace, project, 'master/LICENSE')) + project_blob_path(project, 'master/LICENSE')) expect(page).to have_content('MIT License') expect(page).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") end diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index eab19d52030..77f97826427 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -9,13 +9,13 @@ feature 'project owner sees a link to create a license file in empty project', f end scenario 'project master creates a license file from a template' do - visit namespace_project_path(project.namespace, project) + visit project_path(project) click_link 'Create empty bare repository' click_on 'LICENSE' expect(page).to have_content('New file') expect(current_path).to eq( - namespace_project_new_blob_path(project.namespace, project, 'master')) + project_new_blob_path(project, 'master')) expect(find('#file_name').value).to eq('LICENSE') expect(page).to have_selector('.license-selector') @@ -31,7 +31,7 @@ feature 'project owner sees a link to create a license file in empty project', f click_button 'Commit changes' expect(current_path).to eq( - namespace_project_blob_path(project.namespace, project, 'master/LICENSE')) + project_blob_path(project, 'master/LICENSE')) expect(page).to have_content('MIT License') expect(page).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") end diff --git a/spec/features/projects/files/template_type_dropdown_spec.rb b/spec/features/projects/files/template_type_dropdown_spec.rb index 028a0919640..53b673538e5 100644 --- a/spec/features/projects/files/template_type_dropdown_spec.rb +++ b/spec/features/projects/files/template_type_dropdown_spec.rb @@ -31,7 +31,7 @@ feature 'Template type dropdown selector', js: true do context 'editing a matching file' do before do - visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, 'LICENSE')) + visit project_edit_blob_path(project, File.join(project.default_branch, 'LICENSE')) end scenario 'displayed' do @@ -61,7 +61,7 @@ feature 'Template type dropdown selector', js: true do context 'creating a matching file' do before do - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: '.gitignore') + visit project_new_blob_path(project, 'master', file_name: '.gitignore') end scenario 'is displayed' do @@ -79,7 +79,7 @@ feature 'Template type dropdown selector', js: true do context 'creating a file' do before do - visit namespace_project_new_blob_path(project.namespace, project, project.default_branch) + visit project_new_blob_path(project, project.default_branch) end scenario 'type selector is shown' do @@ -129,7 +129,7 @@ def check_type_selector_toggle_text(template_type) end def create_and_edit_file(file_name) - visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: file_name) + visit project_new_blob_path(project, 'master', file_name: file_name) click_button "Commit changes" - visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, file_name)) + visit project_edit_blob_path(project, File.join(project.default_branch, file_name)) end diff --git a/spec/features/projects/files/undo_template_spec.rb b/spec/features/projects/files/undo_template_spec.rb index 4ccd123f46e..e18ff42942f 100644 --- a/spec/features/projects/files/undo_template_spec.rb +++ b/spec/features/projects/files/undo_template_spec.rb @@ -11,7 +11,7 @@ feature 'Template Undo Button', js: true do context 'editing a matching file and applying a template' do before do - visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, "LICENSE")) + visit project_edit_blob_path(project, File.join(project.default_branch, "LICENSE")) select_file_template('.js-license-selector', 'Apache License 2.0') end @@ -22,7 +22,7 @@ feature 'Template Undo Button', js: true do context 'creating a non-matching file' do before do - visit namespace_project_new_blob_path(project.namespace, project, 'master') + visit project_new_blob_path(project, 'master') select_file_template_type('LICENSE') select_file_template('.js-license-selector', 'Apache License 2.0') end |