From b3dc5378e5c09e91956aa899a6d71f0fc790de5e Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 5 Nov 2012 14:50:13 -0800 Subject: Unit test for is_admin? --- users/test/unit/user_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'users/test/unit') 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 -- cgit v1.2.3