summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-07-22 03:49:14 +0000
committerStan Hu <stanhu@gmail.com>2016-07-22 03:49:14 +0000
commit6c9d1a08fec0fd0adaed01e7025ce3574314495c (patch)
treea8a422b26138e7b867757d23be1cd6a7f74c7748
parentc9a56dac150baa0463fe96753b1f6a3a038e8e38 (diff)
parentc3cbee10bd438a2d8ded30f1a11865693a3d3c6a (diff)
downloadgitlab-ce-6c9d1a08fec0fd0adaed01e7025ce3574314495c.tar.gz
Merge branch '20079-new-wiki-page-500-spec' into 'master'
Add a spec for #20079 - This MR adds a spec for the fix for #20079 that was implemented in !5400. - The spec is going in separately, just so the fix could go in as soon as possible. See merge request !5414
-rw-r--r--features/project/wiki.feature6
-rw-r--r--features/steps/project/wiki.rb10
2 files changed, 16 insertions, 0 deletions
diff --git a/features/project/wiki.feature b/features/project/wiki.feature
index d4811b1ff54..63ce3ccb536 100644
--- a/features/project/wiki.feature
+++ b/features/project/wiki.feature
@@ -8,6 +8,12 @@ Feature: Project Wiki
Given I create the Wiki Home page
Then I should see the newly created wiki page
+ Scenario: Add new page with errors
+ Given I create the Wiki Home page with no content
+ Then I should see a "Content can't be blank" error message
+ When I create the Wiki Home page
+ Then I should see the newly created wiki page
+
Scenario: Pressing Cancel while editing a brand new Wiki
Given I click on the Cancel button
Then I should be redirected back to the Edit Home Wiki page
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
index 3cbf832c728..5ad82a9b3c1 100644
--- a/features/steps/project/wiki.rb
+++ b/features/steps/project/wiki.rb
@@ -19,6 +19,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
click_on "Create page"
end
+ step 'I create the Wiki Home page with no content' do
+ fill_in "wiki_content", with: ''
+ click_on "Create page"
+ end
+
step 'I should see the newly created wiki page' do
expect(page).to have_content "Home"
expect(page).to have_content "link test"
@@ -173,6 +178,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
find('a[href*="?version_id"]')
end
+ step 'I should see a "Content can\'t be blank" error message' do
+ expect(page).to have_content('The form contains the following error:')
+ expect(page).to have_content('Content can\'t be blank')
+ end
+
def wiki
@project_wiki = ProjectWiki.new(project, current_user)
end