ticket_spec.rb 907 B

1234567891011121314151617181920212223242526
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Mobile > Ticket', app: :mobile, authenticated_as: :agent, type: :system do
  4. let(:group) { create(:group) }
  5. let(:agent) { create(:agent, groups: [group]) }
  6. let(:ticket) { create(:ticket, title: 'Ticket Title', group: group) }
  7. # TODO: we should add a test which checks also the handling for multiple tabs
  8. context 'when subscribing to a ticket' do
  9. it 'updates the content on the page' do
  10. visit "/tickets/#{ticket.id}"
  11. wait_for_gql 'apps/mobile/entities/ticket/graphql/queries/ticketWithMentionLimit.graphql'
  12. expect(page).to have_text('Ticket Title')
  13. wait_for_subscription_start 'ticketUpdates'
  14. ticket.update!(title: 'New Title')
  15. wait_for_subscription_update 'ticketUpdates'
  16. expect(page).to have_text('New Title')
  17. end
  18. end
  19. end