formatting_helper_spec.rb 730 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe FormattingHelper do
  4. include Devise::Test::ControllerHelpers
  5. describe '#rss_status_content_format' do
  6. let(:status) { Fabricate(:status, text: 'Hello world<>', spoiler_text: 'This is a spoiler<>', poll: Fabricate(:poll, options: %w(Yes<> No))) }
  7. let(:html) { helper.rss_status_content_format(status) }
  8. it 'renders the spoiler text' do
  9. expect(html).to include('<p>This is a spoiler&lt;&gt;</p><hr>')
  10. end
  11. it 'renders the status text' do
  12. expect(html).to include('<p>Hello world&lt;&gt;</p>')
  13. end
  14. it 'renders the poll' do
  15. expect(html).to include('<radio disabled="disabled">Yes&lt;&gt;</radio><br>')
  16. end
  17. end
  18. end