diff options
author | azul <azul@riseup.net> | 2013-07-11 00:37:45 -0700 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-07-11 00:37:45 -0700 |
commit | 02b69c78eed7682c24cb8361da094bdac45a7749 (patch) | |
tree | a45ed7076a96ddb1601cf9a2e44ae37160f90319 /users/test/functional/users_controller_test.rb | |
parent | 3113f8b814417a896ad5340fda88927733f8ab22 (diff) | |
parent | a40a83cb07d9aba8915cd2c4a25aa76e0cf6760e (diff) |
Merge pull request #56 from leapcode/feature/disable_account
Feature/disable account
Diffstat (limited to 'users/test/functional/users_controller_test.rb')
-rw-r--r-- | users/test/functional/users_controller_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb index 92a5f6c..0ce5cc2 100644 --- a/users/test/functional/users_controller_test.rb +++ b/users/test/functional/users_controller_test.rb @@ -142,4 +142,22 @@ class UsersControllerTest < ActionController::TestCase assert assigns(:users) end + test "user cannot enable own account" do + user = find_record :user + login + post :enable, :id => user.id + assert_access_denied + end + + test "admin can deactivate user" do + user = find_record :user + assert user.enabled? + user.expects(:save).returns(true) + + login :is_admin? => true + + post :deactivate, :id => user.id + assert !assigns(:user).enabled? + end + end |