role_group_spec.rb 544 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. require 'models/concerns/has_group_relation_definition_examples'
  4. RSpec.describe RoleGroup do
  5. let!(:group_relation_instance) { create(:role) }
  6. it_behaves_like 'HasGroupRelationDefinition'
  7. it 'prevents roles from beeing in Group assets' do
  8. group = create(:group)
  9. described_class.create!(
  10. group: group,
  11. role: create(:role)
  12. )
  13. expect(group.assets({})[:Group][group.id]).not_to include('role_ids')
  14. end
  15. end