ticket_spec.rb 883 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe ExcelSheet::Ticket do
  4. let(:ticket) { create(:ticket) }
  5. let(:tag_name) { 'foo' }
  6. let(:instance) { described_class.new(title: 'some title', ticket_ids: [ticket.id], timezone: 'Europe/Berlin', locale: 'de-de') }
  7. before do
  8. Tag.tag_add(object: 'Ticket', item: tag_name, o_id: 1, created_by_id: 1)
  9. end
  10. describe '#ticket_header' do
  11. it 'has Tags once' do
  12. tags_count = instance.ticket_header.count { |elem| elem[:display] == 'Tags' }
  13. expect(tags_count).to eq 1
  14. end
  15. it 'has 31 column in default configuration' do
  16. tags_count = instance.ticket_header.count
  17. expect(tags_count).to eq 31
  18. end
  19. it 'all elements have width attribute' do
  20. expect(instance.ticket_header).to all(have_key(:width))
  21. end
  22. end
  23. end