summaryrefslogtreecommitdiff
path: root/users/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-19 16:02:02 +0200
committerAzul <azul@leap.se>2013-07-24 10:56:45 +0200
commitd70c5796a2989b7b43f7e287899fb1394ae28280 (patch)
treedaeabe5bdcc2386a201d88d838b4b1e387dd9ee3 /users/test/functional
parentc0527cc18788fc60180d9293a546c93e6a77b788 (diff)
separate signup and settings service objects for user
Diffstat (limited to 'users/test/functional')
-rw-r--r--users/test/functional/v1/users_controller_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/users/test/functional/v1/users_controller_test.rb b/users/test/functional/v1/users_controller_test.rb
index 0d44e50..a330bf3 100644
--- a/users/test/functional/v1/users_controller_test.rb
+++ b/users/test/functional/v1/users_controller_test.rb
@@ -5,7 +5,9 @@ class V1::UsersControllerTest < ActionController::TestCase
test "user can change settings" do
user = find_record :user
changed_attribs = record_attributes_for :user_with_settings
- user.expects(:update_attributes).with(changed_attribs)
+ account_settings = stub
+ account_settings.expects(:update).with(changed_attribs)
+ AccountSettings.expects(:new).with(user).returns(account_settings)
login user
put :update, :user => changed_attribs, :id => user.id, :format => :json
@@ -18,7 +20,9 @@ class V1::UsersControllerTest < ActionController::TestCase
test "admin can update user" do
user = find_record :user
changed_attribs = record_attributes_for :user_with_settings
- user.expects(:update_attributes).with(changed_attribs)
+ account_settings = stub
+ account_settings.expects(:update).with(changed_attribs)
+ AccountSettings.expects(:new).with(user).returns(account_settings)
login :is_admin? => true
put :update, :user => changed_attribs, :id => user.id, :format => :json