Skip to content

Commit

Permalink
Integration test for ticket #55 [#55 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Seppä committed Oct 6, 2008
1 parent 6ab2403 commit 67ca2d4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 27 deletions.
5 changes: 5 additions & 0 deletions stories/steps/default.rb
Expand Up @@ -7,6 +7,11 @@
fills_in 'anonymous[name]', :with => 'anonymous'
fills_in 'anonymous[email]', :with => 'anonymous@email.org'
end

When "the user fills in the anonymous name and email fields with incorrect data" do
fills_in 'anonymous[name]', :with => ''
fills_in 'anonymous[email]', :with => 'anonymous@email'
end

Then "the $object's $name is set to '$value'" do |object, name, value|
object = instance_variable_get("@#{object.downcase}")
Expand Down
71 changes: 44 additions & 27 deletions stories/stories/wiki/editing_a_wikipage.txt
Expand Up @@ -4,32 +4,49 @@ Story: Editing a wikipage
I want to edit a wikipage
So I can contribute to the wiki

Scenario: An anonymous user edits a wikipage
Given page cache is enabled and empty
And a wiki that allows anonymous users to create and update wikipages
And a wikipage
When the user visits the wikipage page
Then the page shows 'the wikipage body'
And the page is cached
When the user clicks on 'edit'
Then the page has a wikipage edit form
And the form contains anonymous name and email fields
And the page is not cached
Scenario: An anonymous user edits a wikipage
Given page cache is enabled and empty
And a wiki that allows anonymous users to create and update wikipages
And a wikipage
When the user visits the wikipage page
Then the page shows 'the wikipage body'
And the page is cached
When the user clicks on 'edit'
Then the page has a wikipage edit form
And the form contains anonymous name and email fields
And the page is not cached
When the user fills in wikipage_body with 'the updated wikipage body'
And the user fills in the anonymous name and email fields
And the user clicks the 'Save' button
Then a new version of the wikipage is created
And the page shows 'the updated wikipage body'
And the page is cached

Scenario: User input is retained when an anonymous user edits a wikipage with incorrect info (ticket #55)
Given a wiki that allows anonymous users to create and update wikipages
And a wikipage
When the user visits the wikipage page
Then the page shows 'the wikipage body'
When the user clicks on 'edit'
Then the page has a wikipage edit form
And the form contains anonymous name and email fields
When the user fills in wikipage_body with 'the updated wikipage body'
And the user fills in the anonymous name and email fields
And the user fills in the anonymous name and email fields with incorrect data
And the user clicks the 'Save' button
Then a new version of the wikipage is created
And the page shows 'the updated wikipage body'
And the page is cached

Scenario: A registered user edits a wikipage
Given a wiki that allows registered users to create and update wikipages
And a wikipage
And the user is logged in as user
When the user visits the wikipage edit page
Then the page has a wikipage edit form
And the form does not contain anonymous name and email fields
When the user fills in wikipage_body with 'the updated wikipage body'
And the user clicks the 'Save' button
Then a new version of the wikipage is created
And the wikipage's body is set to 'the updated wikipage body'
Then the flash contains an error message
When the user fills in the anonymous name and email fields
And the user clicks the 'Save' button
Then a new version of the wikipage is created
And the page shows 'the updated wikipage body'

Scenario: A registered user edits a wikipage
Given a wiki that allows registered users to create and update wikipages
And a wikipage
And the user is logged in as user
When the user visits the wikipage edit page
Then the page has a wikipage edit form
And the form does not contain anonymous name and email fields
When the user fills in wikipage_body with 'the updated wikipage body'
And the user clicks the 'Save' button
Then a new version of the wikipage is created
And the wikipage's body is set to 'the updated wikipage body'

0 comments on commit 67ca2d4

Please sign in to comment.