mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-07 12:16:14 +00:00
Add coverage for extra attributes scenario in Admin::Trends::StatusesHelper#one_line_preview
method (#34353)
This commit is contained in:
parent
0653374c34
commit
501ced4239
|
@ -28,6 +28,19 @@ RSpec.describe Admin::Trends::StatusesHelper do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with a remote status that has excessive attributes' do
|
||||||
|
let(:attr_limit) { Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES * 2 }
|
||||||
|
let(:html) { "<html><body #{(1..attr_limit).map { |x| "attr-#{x}" }.join(' ')}><p>text</p></body></html>" }
|
||||||
|
|
||||||
|
let(:status) { Fabricate.build(:status, uri: 'https://host.example', text: html) }
|
||||||
|
|
||||||
|
it 'renders a correct preview text' do
|
||||||
|
result = helper.one_line_preview(status)
|
||||||
|
|
||||||
|
expect(result).to eq ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with a status that has empty text' do
|
context 'with a status that has empty text' do
|
||||||
let(:status) { Fabricate.build(:status, text: '') }
|
let(:status) { Fabricate.build(:status, text: '') }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user