summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-11-05 14:50:13 -0800
committerjessib <jessib@riseup.net>2012-11-05 14:50:13 -0800
commitb3dc5378e5c09e91956aa899a6d71f0fc790de5e (patch)
tree042974e60bc75e7ed3f3a3c1b69fd51013144cd6 /users/test/unit/user_test.rb
parentc7177593aaf2b1b8fd8dbd53b9cfb6562e1411d7 (diff)
Unit test for is_admin?
Diffstat (limited to 'users/test/unit/user_test.rb')
-rw-r--r--users/test/unit/user_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
index f057ca7..9977fca 100644
--- a/users/test/unit/user_test.rb
+++ b/users/test/unit/user_test.rb
@@ -48,4 +48,15 @@ class UserTest < ActiveSupport::TestCase
assert_equal client_rnd, srp_session.aa
end
+ test 'is user an admin' do
+ admin_login = APP_CONFIG['admins'].first
+ attribs = User.valid_attributes_hash
+ attribs[:login] = admin_login
+ admin_user = User.new(attribs)
+ assert admin_user.is_admin?
+ assert !@user.is_admin?
+
+ end
+
+
end