Permalink
Browse files

Cucumber feature for profile

  • Loading branch information...
1 parent c45ed18 commit 2a4067b88b8ff502f855c237ecee1714df38d454 @pbjorklund pbjorklund committed Mar 31, 2012
Showing with 38 additions and 0 deletions.
  1. +28 −0 features/profile.feature
  2. +10 −0 features/step_definitions/shared_steps.rb
View
@@ -0,0 +1,28 @@
+Feature: Updating user profile
+
+ To share information about me or update my settings
+ As a user
+ I want to be able to update my settings
+
+ Scenario: Changing user-name
+ Given I am a new authenticated user
+ When I visit "/users/edit"
+ And I fill in my user details without submitting
+ And I fill in "User Name" with "newtestname"
+ And I click the button "Update"
+ Then I should see "You updated your account successfully."
+
+ Scenario: Changing password
+ Given I am a new authenticated user
+ When I visit "/users/edit"
+ And I fill in my user details without submitting
+ And I fill in "Password" with "newtestpassword"
+ And I fill in "Password confirmation" with "newtestpassword"
+ And I click the button "Update"
+ Then I should see "You updated your account successfully."
+
+ Scenario: Deleting account
+ Given I am a new authenticated user
+ When I visit "/users/edit"
+ And I click "Cancel my account"
+ Then I should see "Bye! Your account was successfully cancelled. We hope to see you again soon."
@@ -38,3 +38,13 @@
Then /^I should see "([^"]*)"$/ do |text|
page.should have_content(text)
end
+
+When /^I visit "([^"]*)"$/ do |page|
+ visit page
+end
+
+When /^I fill in my user details without submitting$/ do
+ fill_in 'User Name', with: 'pbjorklund'
+ fill_in 'Email', with: 'p.bjorklund@gmail.com'
+ fill_in 'Current password', :with => 'secretpass'
+end

0 comments on commit 2a4067b

Please sign in to comment.