2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2018-06-25 10:35:57 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
require 'models/concerns/has_group_relation_definition_examples'
|
|
|
|
|
|
|
|
RSpec.describe RoleGroup do
|
|
|
|
|
|
|
|
let!(:group_relation_instance) { create(:role) }
|
|
|
|
|
2019-01-24 10:13:04 +00:00
|
|
|
it_behaves_like 'HasGroupRelationDefinition'
|
2018-06-25 10:35:57 +00:00
|
|
|
|
|
|
|
it 'prevents roles from beeing in Group assets' do
|
|
|
|
|
|
|
|
group = create(:group)
|
|
|
|
|
|
|
|
described_class.create!(
|
|
|
|
group: group,
|
|
|
|
role: create(:role)
|
|
|
|
)
|
|
|
|
expect(group.assets({})[:Group][group.id]).not_to include('role_ids')
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|