From c2cb152114ef25b783667026c0e5ad1e66e48ed5 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Wed, 19 Apr 2017 09:37:43 +0200 Subject: [PATCH] Fixed issue #839 - Dont allow "none" admin user. --- test/unit/object_cache_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/object_cache_test.rb b/test/unit/object_cache_test.rb index 4fa641e22..efde82d9b 100644 --- a/test/unit/object_cache_test.rb +++ b/test/unit/object_cache_test.rb @@ -37,6 +37,21 @@ class ObjectCacheTest < ActiveSupport::TestCase test 'user cache' do roles = Role.where( name: %w(Agent Admin) ) 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( login: 'object_cache1@example.org', firstname: 'object_cache1',