From 6e8a45145722c12dee4d15b33cc28d2b09881e1a Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 18 Dec 2012 11:46:58 +0100 Subject: 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. --- users/test/functional/users_controller_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'users') 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 -- cgit v1.2.3