@@ -121,11 +121,50 @@ def sign_in
121
121
sign_in
122
122
end
123
123
124
- When /^I edit my account details$/ do
124
+ When ( /^I save the edit form$/ ) do
125
+ click_button "Update"
126
+ end
127
+
128
+ When /^I edit my account name$/ do
125
129
click_link "Edit account"
126
130
fill_in "user_name" , :with => "newname"
127
131
fill_in "user_current_password" , :with => @visitor [ :password ]
128
- click_button "Update"
132
+ end
133
+
134
+ When /^I edit my email address$/ do
135
+ click_link "Edit account"
136
+ fill_in "user_email" , :with => "[email protected] "
137
+ fill_in "user_current_password" , :with => @visitor [ :password ]
138
+ end
139
+
140
+ When ( /^I don't enter my current password$/ ) do
141
+ fill_in "user_current_password" , :with => ""
142
+ end
143
+
144
+ When ( /^I edit my email address with an invalid email$/ ) do
145
+ click_link "Edit account"
146
+ fill_in "user_email" , :with => "notanemail"
147
+ fill_in "user_current_password" , :with => @visitor [ :password ]
148
+ end
149
+
150
+ When ( /^I edit my password$/ ) do
151
+ click_link "Edit account"
152
+ fill_in "user_password" , :with => "newpassword"
153
+ fill_in "user_password_confirmation" , :with => "newpassword"
154
+ fill_in "user_current_password" , :with => @visitor [ :password ]
155
+ end
156
+
157
+ When ( /^I edit my password with missing confirmation$/ ) do
158
+ click_link "Edit account"
159
+ fill_in "user_password" , :with => "newpassword"
160
+ fill_in "user_current_password" , :with => @visitor [ :password ]
161
+ end
162
+
163
+ When ( /^I edit my password with missmatched confirmation$/ ) do
164
+ click_link "Edit account"
165
+ fill_in "user_password" , :with => "newpassword"
166
+ fill_in "user_password_confirmation" , :with => "newpassword123"
167
+ fill_in "user_current_password" , :with => @visitor [ :password ]
129
168
end
130
169
131
170
When /^I look at the list of users$/ do
@@ -185,6 +224,10 @@ def sign_in
185
224
page . should have_content "You updated your account successfully."
186
225
end
187
226
227
+ Then ( /^I should see a current password missing message$/ ) do
228
+ page . should have_content "Current password can't be blank"
229
+ end
230
+
188
231
Then /^I should see my name$/ do
189
232
create_user
190
233
page . should have_content @user [ :name ]
0 commit comments