diff options
author | Azul <azul@leap.se> | 2012-12-18 11:46:58 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-12-18 11:46:58 +0100 |
commit | 6e8a45145722c12dee4d15b33cc28d2b09881e1a (patch) | |
tree | 6e4c35ca7d6b85070a5e452e55693009678ec9e8 /users/test/functional | |
parent | 6393a9d705f181bd7f81270b01448ae93acb96e5 (diff) |
adjusted tests - we now reload the user so invalid records are cleared
Actually that might not be the best idea.
Issue at hand was that invalid email aliases were getting displayed when rendering the edit form again. We probably want to solve this different.
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 ce17500..b31a642 100644 --- a/users/test/functional/users_controller_test.rb +++ b/users/test/functional/users_controller_test.rb @@ -45,11 +45,12 @@ class UsersControllerTest < ActionController::TestCase assert_equal user, assigns[:user] end - test "should process updated params" do + test "user can change settings" do user = find_record User user.expects(:attributes=).with(user.params) user.expects(:changed?).returns(true) user.expects(:save).returns(true) + user.expects(:reload).returns(user) login user put :update, :user => user.params, :id => user.id, :format => :json @@ -64,6 +65,7 @@ class UsersControllerTest < ActionController::TestCase user.expects(:attributes=).with(user.params) user.expects(:changed?).returns(true) user.expects(:save).returns(true) + user.expects(:reload).returns(user) login :is_admin? => true put :update, :user => user.params, :id => user.id, :format => :json |