From d9af6f79ed439308d13f44a0cfade6a355607f14 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 15 Sep 2015 06:58:49 -0700 Subject: Change the replace placeholder to use the filename Dynamically adjust placedholder for uploads and fix Dropzone event handlers Override error handler to prevent error messages from being inserted underneath image preview Fix tests Use regexp instead of startsWith for better browser compatibility Remove duplicate code in _replace.html.haml and use one template Remove files upon error and retain alert messages until user adds a new file --- features/project/source/browse_files.feature | 6 +++--- features/steps/project/source/browse_files.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'features') diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index b5b6abe6aff..58574166ef3 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -33,13 +33,13 @@ Feature: Project Source Browse Files And I click on "Commit Changes" Then I am redirected to the new file And I should see its new content - + @javascript Scenario: I can upload file and commit Given I click on "new file" link in repo Then I can see new file page - And I can see "upload existing one" - And I click on "upload existing one" + And I can see "upload an existing one" + And I click on "upload" And I upload a new text file And I fill the upload file commit message And I click on "Upload file" diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 7a0ee4df45e..a1a49dd58a6 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -119,12 +119,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content "Commit message" end - step 'I can see "upload existing one"' do - expect(page).to have_content "upload existing one" + step 'I can see "upload an existing one"' do + expect(page).to have_content "upload an existing one" end - step 'I click on "upload existing one"' do - click_link 'upload existing one' + step 'I click on "upload"' do + click_link 'upload' end step 'I click on "Upload file"' do @@ -150,7 +150,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I fill the replace file commit message' do - page.within('#modal-replace-blob') do + page.within('#modal-upload-blob') do fill_in :commit_message, with: 'Replacement file commit message' end end -- cgit v1.2.1