summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-05-26 20:05:25 +0200
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-05-26 20:05:25 +0200
commitaa36a19613c37af8598741683e799402c72d2772 (patch)
treef6630fa0066cac95cc56b12335e946d38d76f3ef /features
parent5c2acc51e24db47aa4d4efbeba792c3b90d9b923 (diff)
parentb16aad9dd1de60585f8265eff11cdea19982740d (diff)
downloadgitlab-ce-aa36a19613c37af8598741683e799402c72d2772.tar.gz
Merge pull request #9319 from jvanbaarsen/validate-wiki-page-creation
Validate wiki page creation
Diffstat (limited to 'features')
-rw-r--r--features/project/wiki.feature5
-rw-r--r--features/steps/project/wiki.rb10
2 files changed, 15 insertions, 0 deletions
diff --git a/features/project/wiki.feature b/features/project/wiki.feature
index 977cd609a11..7a70f348754 100644
--- a/features/project/wiki.feature
+++ b/features/project/wiki.feature
@@ -69,6 +69,11 @@ Feature: Project Wiki
And I click on the "Pages" button
Then I should see non-escaped link in the pages list
+ @javascript @focus
+ Scenario: Creating an invalid new page
+ Given I create a New page with an invalid name
+ Then I should see an error message
+
@javascript
Scenario: Edit Wiki page that has a path
Given I create a New page with paths
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
index 717132da45d..58cb0ceb3f1 100644
--- a/features/steps/project/wiki.rb
+++ b/features/steps/project/wiki.rb
@@ -133,6 +133,16 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
current_path.should include 'one/two/three'
end
+ step 'I create a New page with an invalid name' do
+ click_on 'New Page'
+ fill_in 'Page slug', with: 'invalid name'
+ click_on 'Build'
+ end
+
+ step 'I should see an error message' do
+ expect(page).to have_content "The page slug is invalid"
+ end
+
step 'I should see non-escaped link in the pages list' do
page.should have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']")
end