diff options
author | Francis Irving <francis@mysociety.org> | 2009-11-01 17:19:39 +0000 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2009-11-01 17:19:39 +0000 |
commit | 35d5afce0690dfeeccfefca25131db3733bf8baf (patch) | |
tree | 2fba1df3db05f46ffe7d8a8a14f05168f15e07b4 | |
parent | fdad3e0740da334b53044aa60e843daacdaf5f9b (diff) |
Pad out a couple of incomplete tests that were there already.
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index f6f3c16ca..700618f53 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -274,9 +274,25 @@ describe UserController, "when changing password" do end it "should not change the password, if you're not logged in" do + session[:user_circumstance] = "change_password" + + old_hash = users(:bob_smith_user).hashed_password + post :signchange, { :user => { :password => 'ooo', :password_confirmation => 'ooo' }, + :submitted_signchange_password => 1 + } + users(:bob_smith_user).hashed_password.should == old_hash end it "should not change the password, if you're just logged in normally" do + session[:user_id] = users(:bob_smith_user).id + session[:user_circumstance] = nil + + old_hash = users(:bob_smith_user).hashed_password + post :signchange, { :user => { :password => 'ooo', :password_confirmation => 'ooo' }, + :submitted_signchange_password => 1 + } + + users(:bob_smith_user).hashed_password.should == old_hash end end |