summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-12-17 09:21:22 +0100
committerAzul <azul@leap.se>2012-12-17 09:21:22 +0100
commit728a4c0df4c0957f4402a5f0dd517b1bff77d7d1 (patch)
treea3f6c610a2a7a73eab6b9df05da0e9c851a864a5
parent30f953c06bbd71becfc59afb3fb49abaa853eacc (diff)
fixed all user functional tests
-rw-r--r--users/test/functional/users_controller_test.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb
index 1840a72..79c22c4 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/users/test/functional/users_controller_test.rb
@@ -35,7 +35,10 @@ class UsersControllerTest < ActionController::TestCase
end
test "should get edit view" do
- user = find_record User, :email => nil, :email_forward => nil
+ user = find_record User,
+ :email => nil,
+ :email_forward => nil,
+ :email_aliases => []
login user
get :edit, :id => user.id
@@ -45,7 +48,9 @@ class UsersControllerTest < ActionController::TestCase
test "should process updated params" do
user = find_record User
- user.expects(:update_attributes).with(user.params).returns(true)
+ user.expects(:attributes=).with(user.params)
+ user.expects(:changed?).returns(true)
+ user.expects(:save).returns(true)
login user
put :update, :user => user.params, :id => user.id, :format => :json
@@ -57,7 +62,9 @@ class UsersControllerTest < ActionController::TestCase
test "admin can update user" do
user = find_record User
- user.expects(:update_attributes).with(user.params).returns(true)
+ user.expects(:attributes=).with(user.params)
+ user.expects(:changed?).returns(true)
+ user.expects(:save).returns(true)
login :is_admin? => true
put :update, :user => user.params, :id => user.id, :format => :json