response_spec.rb 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe MonitoringHelper::HealthChecker::Response do
  4. let(:instance) { described_class.new }
  5. describe '#merge' do
  6. it 'adds issues from another response' do
  7. other_response = described_class.new
  8. other_response.issues << :another_response
  9. instance.issues << :former_response
  10. instance.merge(other_response)
  11. expect(instance.issues).to match_array(%i[another_response former_response])
  12. end
  13. it 'adds actions from another response' do
  14. other_response = described_class.new
  15. other_response.actions << :another_response
  16. instance.actions << :former_response
  17. instance.merge(other_response)
  18. expect(instance.actions).to match_array(%i[another_response former_response])
  19. end
  20. end
  21. it '#issues is Array' do
  22. expect(instance.issues).to be_instance_of(Array)
  23. end
  24. it '#actions is Set' do
  25. expect(instance.actions).to be_instance_of(Set)
  26. end
  27. end