summaryrefslogtreecommitdiff
path: root/users/test
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-02-25 14:02:28 -0800
committerjessib <jessib@leap.se>2013-02-25 14:02:28 -0800
commit73e9332dadde9f37a85753faf40b9b6b2d73dd88 (patch)
tree9d500a5f85438fad268d53f7900b1623d77aac31 /users/test
parentbace229e4d1cf593eaef80b8e8553d9d33c40c50 (diff)
Admins cannot update a user. Eventually we will want to allow admins to update some user fields.
Diffstat (limited to 'users/test')
-rw-r--r--users/test/functional/users_controller_test.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb
index 9fb06c9..fd8869a 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/users/test/functional/users_controller_test.rb
@@ -130,20 +130,17 @@ class UsersControllerTest < ActionController::TestCase
assert_equal " ", @response.body
end
- test "admin can update user" do
+ # Eventually, admin will be able to update some user fields
+ test "admin cannot update user" do
user = find_record :user
changed_attribs = record_attributes_for :user_with_settings
- user.expects(:attributes=).with(changed_attribs.stringify_keys)
- user.expects(:changed?).returns(true)
- user.expects(:save).returns(true)
- user.stubs(:email_aliases).returns([])
login :is_admin? => true
put :update, :user => changed_attribs, :id => user.id, :format => :json
- assert_equal user, assigns[:user]
- assert_response 204
- assert_equal " ", @response.body
+ assert_response :redirect
+ assert_access_denied
+
end
test "admin can destroy user" do