File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
features/step_definitions Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11Given ( /^User foo@example\. com has not changed password for (\d +) months$/ ) do |changed |
22 @user = User . make! (
33 password : 'abc123abc' ,
4- password_changed_at : changed . to_i . months . ago
4+ password_changed_at : ( changed . to_i . months + 1 . days ) . ago ,
55 )
66 Institution . make! user : @user
77end
1212
1313Given ( /^the previous passwords$/ ) do |table |
1414 @prev_passwords = table . raw . flatten [ 1 ..-1 ] . unshift ( @user . password )
15+ password_changed_at = @user . password_changed_at
1516 table . hashes . each do |hash |
1617 @user . password = hash [ 'password' ]
1718 @user . password_confirmation = hash [ 'password' ]
1819 @user . save!
1920 end
20- @user . password_changed_at = 3 . months . ago
21- @user . save!
21+ # reset
22+ @user . update! ( password_changed_at : password_changed_at )
2223end
2324
2425When ( /^they try to use one of previous (\d +) passwords$/ ) do |arg1 |
You can’t perform that action at this time.
0 commit comments