remote_content_removed_spec.rb 999 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Ticket Zoom > Remote Content Removed', authenticated_as: :user, type: :system do
  4. let(:article) { create(:ticket_article, :inbound_email, ticket: ticket, preferences: preferences) }
  5. let(:preferences) { { remote_content_removed: true } }
  6. let(:ticket) { create(:ticket) }
  7. let(:user) { create(:agent, groups: [ticket.group]) }
  8. before do
  9. article
  10. visit "#ticket/zoom/#{ticket.id}"
  11. end
  12. context 'when a mail with an inline image is received' do
  13. it 'shows a message that the image was removed' do
  14. within(:active_content) do
  15. expect(page).to have_text('For privacy reasons, Zammad has blocked remote content in this message.')
  16. end
  17. end
  18. it 'shows a button to retrieve the original formatting' do
  19. within(:active_content) do
  20. expect(page).to have_css('.js-fetchOriginalFormatting')
  21. end
  22. end
  23. end
  24. end