summaryrefslogtreecommitdiff
path: root/users/test/functional
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-02-26 10:45:52 -0800
committerjessib <jessib@riseup.net>2013-02-26 10:45:52 -0800
commit994f8d23a5a961b8656136eae2aec56204293c52 (patch)
tree09a6cbcd6c4fad8fcf130d6c2d268afe025886ca /users/test/functional
parent5dbbf733a6abe809a38667e8b3277fd06db24788 (diff)
parent73e9332dadde9f37a85753faf40b9b6b2d73dd88 (diff)
Merge pull request #28 from leapcode/feature/change_login
Feature/change login
Diffstat (limited to 'users/test/functional')
-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