Add test for handling answers that don't need to be shortened for tweets
This commit is contained in:
parent
3204aaa2e9
commit
570425821f
|
@ -31,5 +31,16 @@ describe Services::Twitter do
|
||||||
|
|
||||||
expect(twitter_client).to have_received(:update!).with("#{'q' * 123}… — #{'a' * 124}… https://example.com/#{user.screen_name}/a/#{answer.id}")
|
expect(twitter_client).to have_received(:update!).with("#{'q' * 123}… — #{'a' * 124}… https://example.com/#{user.screen_name}/a/#{answer.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "posts an un-shortened tweet" do
|
||||||
|
answer.question.content = 'Why are raccoons so good?'
|
||||||
|
answer.question.save!
|
||||||
|
answer.content = 'Because they are good cunes.'
|
||||||
|
answer.save!
|
||||||
|
|
||||||
|
service.post(answer)
|
||||||
|
|
||||||
|
expect(twitter_client).to have_received(:update!).with("#{answer.question.content} — #{answer.content} https://example.com/#{user.screen_name}/a/#{answer.id}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue