From 697b34d786bcbc9b4fdaef485ff4837b850ca5aa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 13:12:21 +0200 Subject: Render CI statuses on commit page Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/commits/commits.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'features/steps/project') diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 5ebc3a49760..ae5f90004e6 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -104,10 +104,20 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'commit has ci status' do @project.enable_ci - create :ci_commit, gl_project: @project, sha: sample_commit.id + ci_commit = create :ci_commit, gl_project: @project, sha: sample_commit.id + create :ci_build, commit: ci_commit end step 'I see commit ci info' do - expect(page).to have_content "build: skipped" + expect(page).to have_content "build: pending" + end + + step 'I click status link' do + click_link "Builds" + end + + step 'I see builds list' do + expect(page).to have_content "build: pending" + expect(page).to have_content "Builds for master" end end -- cgit v1.2.1 From 0ab6ca93aadaf08f65f36e7fbdb5b837bac6e160 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 16 Sep 2015 22:45:22 -0700 Subject: Add directory feature button Change "+" icon under "Files" section to have three options: * Create file * Upload file * New directory Upload file is no longer accessible from the "Create file" page. Users can now select a target branch in upload file as well. Closes #2799: Fixes a bug where file modes were overwritten after a commit Closes https://github.com/gitlabhq/gitlabhq/issues/8253: Existing files can no longer be overwritten in the "Create file" section. Closes #2557 --- features/steps/project/source/browse_files.rb | 61 ++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 10 deletions(-) (limited to 'features/steps/project') diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index a1a49dd58a6..cb100ca0f54 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -71,7 +71,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I fill the new branch name' do - fill_in :new_branch, with: 'new_branch_name' + fill_in :new_branch, with: 'new_branch_name', visible: true end step 'I fill the new file name with an illegal name' do @@ -90,6 +90,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps click_button 'Commit Changes' end + step 'I click on "Create directory"' do + click_button 'Create directory' + end + step 'I click on "Remove"' do click_button 'Remove' end @@ -110,21 +114,32 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_css '.line_holder.new' end - step 'I click on "new file" link in repo' do - click_link 'new-file-link' + step 'I click on "New file" link in repo' do + find('.add-to-tree').click + click_link 'Create file' end - step 'I can see new file page' do - expect(page).to have_content "new file" - expect(page).to have_content "Commit message" + step 'I click on "Upload file" link in repo' do + find('.add-to-tree').click + click_link 'Upload file' + end + + step 'I click on "New directory" link in repo' do + find('.add-to-tree').click + click_link 'New directory' + end + + step 'I fill the new directory name' do + fill_in :dir_name, with: new_dir_name end - step 'I can see "upload an existing one"' do - expect(page).to have_content "upload an existing one" + step 'I fill an existing directory name' do + fill_in :dir_name, with: 'files' end - step 'I click on "upload"' do - click_link 'upload' + step 'I can see new file page' do + expect(page).to have_content "new file" + expect(page).to have_content "Commit message" end step 'I click on "Upload file"' do @@ -228,10 +243,30 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps @project.namespace, @project, 'new_branch_name/' + new_file_name)) end + step 'I am redirected to the uploaded file on new branch' do + expect(current_path).to eq(namespace_project_blob_path( + @project.namespace, @project, + 'new_branch_name/' + File.basename(test_text_file))) + end + + step 'I am redirected to the new directory' do + expect(current_path).to eq(namespace_project_tree_path( + @project.namespace, @project, 'new_branch_name/' + new_dir_name)) + end + + step 'I am redirected to the root directory' do + expect(current_path).to eq(namespace_project_tree_path( + @project.namespace, @project, 'master/')) + end + step "I don't see the permalink link" do expect(page).not_to have_link('permalink') end + step 'I see "Unable to create directory"' do + expect(page).to have_content('Directory already exists') + end + step 'I see a commit error message' do expect(page).to have_content('Your changes could not be committed') end @@ -287,6 +322,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps 'not_a_file.md' end + # Constant value that is a valid directory and + # not a directory present at root of the seed repository. + def new_dir_name + 'new_dir/subdir' + end + def drop_in_dropzone(file_path) # Generate a fake input selector page.execute_script <<-JS -- cgit v1.2.1 From 4bf69b0bd9a27e675c98eee998f24c0122030731 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 23:59:21 +0200 Subject: Fix feature tests --- features/steps/project/commits/commits.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps/project') diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index ae5f90004e6..a3cb83880e3 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -118,6 +118,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I see builds list' do expect(page).to have_content "build: pending" - expect(page).to have_content "Builds for master" + expect(page).to have_content "Latest builds" end end -- cgit v1.2.1