Fixed issue #839 - Dont allow "none" admin user.
This commit is contained in:
parent
78ddb3b62e
commit
c2cb152114
1 changed files with 15 additions and 0 deletions
|
@ -37,6 +37,21 @@ class ObjectCacheTest < ActiveSupport::TestCase
|
||||||
test 'user cache' do
|
test 'user cache' do
|
||||||
roles = Role.where( name: %w(Agent Admin) )
|
roles = Role.where( name: %w(Agent Admin) )
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
|
# be sure that minimum one admin is available
|
||||||
|
User.create_or_update(
|
||||||
|
login: 'last_admin_check@example.org',
|
||||||
|
firstname: 'last_admin_check',
|
||||||
|
lastname: 'last_admin_check',
|
||||||
|
email: 'last_admin_check@example.org',
|
||||||
|
password: 'some_pass',
|
||||||
|
active: true,
|
||||||
|
updated_by_id: 1,
|
||||||
|
created_by_id: 1,
|
||||||
|
roles: roles,
|
||||||
|
groups: groups,
|
||||||
|
)
|
||||||
|
|
||||||
user1 = User.create_or_update(
|
user1 = User.create_or_update(
|
||||||
login: 'object_cache1@example.org',
|
login: 'object_cache1@example.org',
|
||||||
firstname: 'object_cache1',
|
firstname: 'object_cache1',
|
||||||
|
|
Loading…
Reference in a new issue