profile_spec.rb 848 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Report::Profile, type: :model do
  4. describe 'Organization is removed in the report profile after an reload of the browser tab #5469' do
  5. let(:conditions_orgs) { create_list(:organization, 3) }
  6. let(:report_profile) { create(:report_profile, condition: condition) }
  7. let(:condition) do
  8. {
  9. 'ticket.organization_id' => {
  10. 'operator' => 'is',
  11. 'pre_condition' => 'specific',
  12. 'value' => conditions_orgs.map { |row| row.id.to_s },
  13. 'value_completion' => ''
  14. }
  15. }
  16. end
  17. it 'does contain assets for the conditions' do
  18. expect(report_profile.assets({})[:Organization].keys.sort).to eq(conditions_orgs.map(&:id).sort)
  19. end
  20. end
  21. end