diff --git a/spec/lib/plain_text_formatter_spec.rb b/spec/lib/plain_text_formatter_spec.rb index b22f473d0..4683e1509 100644 --- a/spec/lib/plain_text_formatter_spec.rb +++ b/spec/lib/plain_text_formatter_spec.rb @@ -7,7 +7,7 @@ RSpec.describe PlainTextFormatter do subject { described_class.new(status.text, status.local?).to_s } context 'when status is local' do - let(:status) { Fabricate(:status, text: '
a text by a nerd who uses an HTML tag in text
', uri: nil) } + let(:status) { Fabricate.build(:status, text: 'a text by a nerd who uses an HTML tag in text
', uri: nil) } it 'returns the raw text' do expect(subject).to eq 'a text by a nerd who uses an HTML tag in text
' @@ -15,10 +15,10 @@ RSpec.describe PlainTextFormatter do end context 'when status is remote' do - let(:remote_account) { Fabricate(:account, domain: 'remote.test', username: 'bob', url: 'https://remote.test/') } + let(:remote_account) { Fabricate.build(:account, domain: 'remote.test', username: 'bob', url: 'https://remote.test/') } context 'when text contains inline HTML tags' do - let(:status) { Fabricate(:status, account: remote_account, text: 'Lorem ipsum') } + let(:status) { Fabricate.build(:status, account: remote_account, text: 'Lorem ipsum') } it 'strips the tags' do expect(subject).to eq 'Lorem ipsum' @@ -26,7 +26,7 @@ RSpec.describe PlainTextFormatter do end context 'when text containstags' do - let(:status) { Fabricate(:status, account: remote_account, text: '
Lorem
ipsum
') } + let(:status) { Fabricate.build(:status, account: remote_account, text: 'Lorem
ipsum
') } it 'inserts a newline' do expect(subject).to eq "Lorem\nipsum" @@ -34,7 +34,7 @@ RSpec.describe PlainTextFormatter do end context 'when text contains a singleLorem 明日 ipsum
') } + let(:status) { Fabricate.build(:status, account: remote_account, text: 'Lorem 明日 ipsum
') } it 'strips the comment' do expect(subject).to eq 'Lorem 明日 (Ashita) ipsum'