shared_draft_zoom_spec.rb 947 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Ticket::SharedDraftZoom, type: :model do
  4. subject(:shared_draft_zoom) { create(:ticket_shared_draft_zoom) }
  5. it { is_expected.to belong_to :ticket }
  6. it { expect(shared_draft_zoom.new_article).to be_a(Hash) }
  7. it { expect(shared_draft_zoom.ticket_attributes).to be_a(Hash) }
  8. describe 'Draft Sharing: Add history entry for updating and deleting of a draft #3983' do
  9. it 'does create a history entry for the new draft' do
  10. expect(shared_draft_zoom.ticket.history_get)
  11. .to include(include('object' => 'Ticket::SharedDraftZoom', 'type' => 'created'))
  12. end
  13. it 'does add a history entry for removing the draft' do
  14. shared_draft_zoom.destroy
  15. expect(shared_draft_zoom.ticket.history_get)
  16. .to include(include('object' => 'Ticket::SharedDraftZoom', 'type' => 'removed'))
  17. end
  18. end
  19. end