Added permission support for auto wizard.

This commit is contained in:
Martin Edenhofer 2017-10-23 16:33:16 +02:00
parent b258ae24e6
commit 340fe10d07
2 changed files with 17 additions and 1 deletions

View file

@ -88,8 +88,9 @@ returns
end end
end end
# create EmailAddresses/Channels/Signatures # create Permissions/Organization
model_map = { model_map = {
'Permissions' => 'Permission',
'Organizations' => 'Organization', 'Organizations' => 'Organization',
} }
model_map.each do |map_name, model| model_map.each do |map_name, model|

View file

@ -126,6 +126,16 @@ class AutoWizardTest < ActiveSupport::TestCase
value: 'Zammad UnitTest02 System' value: 'Zammad UnitTest02 System'
}, },
], ],
Permissions: [
{
name: 'admin.session',
active: false,
},
{
name: 'admin.session.new',
active: true,
},
],
Channels: [ Channels: [
{ {
id: 1, id: 1,
@ -221,6 +231,11 @@ class AutoWizardTest < ActiveSupport::TestCase
setting_value = Setting.get(local_setting[:name]) setting_value = Setting.get(local_setting[:name])
assert_equal(local_setting[:value], setting_value) assert_equal(local_setting[:value], setting_value)
end end
auto_wizard_data[:Permissions].each do |local_permission|
permission = Permission.find_by(name: local_permission[:name])
assert_equal(local_permission[:name], permission.name)
assert_equal(local_permission[:active], permission.active)
end
end end
def auto_wizard_file_write(data) def auto_wizard_file_write(data)