~cytrogen/masto-fe

ref: 6cdc8408a9ac9d0fd157d18b1ff173c8f416cb8d masto-fe/spec/helpers/formatting_helper_spec.rb -rw-r--r-- 730 bytes
6cdc8408 — Daniel M Brasil Migrate to request specs in `/api/v1/emails/confirmations` (#25686) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'rails_helper'

describe FormattingHelper do
  include Devise::Test::ControllerHelpers

  describe '#rss_status_content_format' do
    let(:status) { Fabricate(:status, text: 'Hello world<>', spoiler_text: 'This is a spoiler<>', poll: Fabricate(:poll, options: %w(Yes<> No))) }
    let(:html) { helper.rss_status_content_format(status) }

    it 'renders the spoiler text' do
      expect(html).to include('<p>This is a spoiler&lt;&gt;</p><hr>')
    end

    it 'renders the status text' do
      expect(html).to include('<p>Hello world&lt;&gt;</p>')
    end

    it 'renders the poll' do
      expect(html).to include('<radio disabled="disabled">Yes&lt;&gt;</radio><br>')
    end
  end
end