diff options
author | Azul <azul@leap.se> | 2012-11-23 12:11:11 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-23 15:09:53 +0100 |
commit | ee3c9146e4bbe93ec1f00ee45386a82ec4363c4d (patch) | |
tree | ec673f97f22c13c19c1f9034dfe88646525bdeae /users/test/functional | |
parent | 716dc248e940be8bd323a9d92f98785737fc99a0 (diff) |
identify user by id so rerendering the form does not use new invalid login
Diffstat (limited to 'users/test/functional')
-rw-r--r-- | users/test/functional/users_controller_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb index 4318928..e39869f 100644 --- a/users/test/functional/users_controller_test.rb +++ b/users/test/functional/users_controller_test.rb @@ -32,6 +32,7 @@ class UsersControllerTest < ActionController::TestCase test "should get edit view" do user = stub_record User + User.expects(:find_by_param).with(user.id.to_s).returns(user) login user get :edit, :id => user.id assert_equal user, assigns[:user] @@ -39,7 +40,8 @@ class UsersControllerTest < ActionController::TestCase test "should process updated params" do user = stub_record User - user.expects(:update).with(user.params).returns(user) + user.expects(:update_attributes).with(user.params).returns(true) + User.expects(:find_by_param).with(user.id.to_s).returns(user) login user post :update, :user => user.params, :id => user.id assert_equal user, assigns[:user] |