diff options
Diffstat (limited to 'features/steps/project/source/browse_files.rb')
-rw-r--r-- | features/steps/project/source/browse_files.rb | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index b4741f06d1b..621cae5d80d 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -4,11 +4,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps include SharedProject include SharedPaths include RepoHelpers + include WaitForRequests step "I don't have write access" do @project = create(:project, :repository, name: "Other Project", path: "other-project") @project.team << [@user, :reporter] - visit namespace_project_tree_path(@project.namespace, @project, root_ref) + visit project_tree_path(@project, root_ref) end step 'I should see files from repository' do @@ -18,7 +19,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see files from repository for "6d39438"' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "6d39438") + expect(current_path).to eq project_tree_path(@project, "6d39438") expect(page).to have_content ".gitignore" expect(page).to have_content "LICENSE" end @@ -36,10 +37,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see its content' do + wait_for_requests expect(page).to have_content old_gitignore_content end step 'I should see its new content' do + wait_for_requests expect(page).to have_content new_gitignore_content end @@ -86,14 +89,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I fill the new branch name' do - first('button.js-target-branch', visible: true).click - find('.create-new-branch', visible: true).click - find('#new_branch_name', visible: true).set('new_branch_name') - find('.js-new-branch-btn', visible: true).click - end - - step 'I fill the new file name with an illegal name' do - fill_in :file_name, with: 'Spaces Not Allowed' + fill_in :branch_name, with: 'new_branch_name', visible: true end step 'I fill the new file name with a new directory' do @@ -240,16 +236,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, 'master') + expect(current_path).to eq project_tree_path(@project, 'master') end step 'I am redirected to the ".gitignore"' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) + expect(current_path).to eq(project_blob_path(@project, 'master/.gitignore')) end step 'I am redirected to the permalink URL' do expect(current_path).to( - eq(namespace_project_blob_path(@project.namespace, @project, + eq(project_blob_path(@project, @project.repository.commit.sha + '/.gitignore')) ) @@ -257,26 +253,26 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I am redirected to the new file' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name)) + project_blob_path(@project, 'master/' + new_file_name)) end step 'I am redirected to the new file with directory' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name_with_directory)) + project_blob_path(@project, 'master/' + new_file_name_with_directory)) end step 'I am redirected to the new merge request page' do - expect(current_path).to eq(new_namespace_project_merge_request_path(@project.namespace, @project)) + expect(current_path).to eq(project_new_merge_request_path(@project)) end step "I am redirected to the fork's new merge request page" do fork = @user.fork_of(@project) - expect(current_path).to eq(new_namespace_project_merge_request_path(fork.namespace, fork)) + expect(current_path).to eq(project_new_merge_request_path(fork)) end step 'I am redirected to the root directory' do expect(current_path).to eq( - namespace_project_tree_path(@project.namespace, @project, 'master')) + project_tree_path(@project, 'master')) end step "I don't see the permalink link" do @@ -327,11 +323,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step "I visit the 'test' tree" do - visit namespace_project_tree_path(@project.namespace, @project, "'test'") + visit project_tree_path(@project, "'test'") end step "I visit the fix tree" do - visit namespace_project_tree_path(@project.namespace, @project, "fix/.testdir") + visit project_tree_path(@project, "fix/.testdir") end step 'I see the commit data' do @@ -346,7 +342,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I click on "files/lfs/lfs_object.iso" file in repo' do allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(true) - visit namespace_project_tree_path(@project.namespace, @project, "lfs") + visit project_tree_path(@project, "lfs") click_link 'files' click_link "lfs" click_link "lfs_object.iso" @@ -364,7 +360,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I should see buttons for allowed commands' do page.within '.content' do - expect(page).to have_link 'Open raw' + expect(page).to have_link 'Download' expect(page).to have_content 'History' expect(page).to have_content 'Permalink' expect(page).not_to have_content 'Edit' @@ -389,7 +385,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I visit the SVG file' do - visit namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/logo_sample.svg') + visit project_blob_path(@project, 'new_branch_name/logo_sample.svg') end step 'I can see the new rendered SVG image' do |