This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2022-12-15 16:39:41 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-05-04 05:49:53 +02:00
|
|
|
describe FormattingHelper do
|
2022-12-15 16:39:41 +01:00
|
|
|
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<></p><hr>')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders the status text' do
|
|
|
|
expect(html).to include('<p>Hello world<></p>')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders the poll' do
|
|
|
|
expect(html).to include('<radio disabled="disabled">Yes<></radio><br>')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|