diff options
Diffstat (limited to 'users/test/unit')
-rw-r--r-- | users/test/unit/user_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb index 29f6a89..5d2a7ea 100644 --- a/users/test/unit/user_test.rb +++ b/users/test/unit/user_test.rb @@ -49,6 +49,16 @@ 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 + test "find user by email" do email = "tryto@find.me" @user.email = email @@ -57,5 +67,4 @@ class UserTest < ActiveSupport::TestCase assert_equal @user, User.find_by_email_or_alias(email) assert_nil User.find_by_email_alias(email) end - end |