Skip to content

Commit 10ea33a

Browse files
committed
Forced user edit details into step definitons
1 parent 512346a commit 10ea33a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

features/step_definitions/user_steps.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,14 @@ def sign_up user
158158
Then /^I see a successfull sign in message$/ do
159159
page.should have_content "Signed in successfully."
160160
end
161+
162+
When /^I edit my account details$/ do
163+
click_link "Edit account"
164+
fill_in "Name", :with => "newname"
165+
fill_in "Current password", :with => valid_user[:password]
166+
click_button "Update"
167+
end
168+
169+
Then /^I should see an account edited message$/ do
170+
page.should have_content "You updated your account successfully."
171+
end

features/users/user_edit.feature

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ Feature: Edit User
44
so I can change my username
55

66
Scenario: I sign in and edit my account
7-
Given I am a user named "foo" with an email "user@test.com" and password "please"
8-
When I sign in as "user@test.com/please"
9-
Then I should be signed in
10-
When I follow "Edit account"
11-
And I fill in "Name" with "baz"
12-
And I fill in "Current password" with "please"
13-
And I press "Update"
14-
And I go to the homepage
15-
Then I should see "User: baz"
7+
Given I am logged in
8+
When I edit my account details
9+
Then I should see an account edited message

0 commit comments

Comments
 (0)