docbrown/spec/services/twitter_client/client_spec.rb
rhymes 300ba1b33f
[deploy] Decouple Twitter authentication from fetching tweets (#7920)
* Add TwitterClient::Client

* Use TwitterClient::Client for Tweet

* Test retweets

* Test assignment to user

* Fix TweetTag spec

* Remove TwitterBot

* Fix some specs

* Fix RSS Reader specs
2020-05-19 18:05:41 -04:00

22 lines
608 B
Ruby

require "rails_helper"
RSpec.describe TwitterClient::Client, type: :service, vcr: true do
let(:tweet_id) { "1018911886862057472" }
describe ".status" do
it "returns a status" do
VCR.use_cassette("twitter_client_status") do
tweet = described_class.status(tweet_id)
expect(tweet.text).to be_present
end
end
it "raises NotFound if the status does not exist" do
VCR.use_cassette("twitter_client_status_not_found") do
expect do
described_class.status(0)
end.to raise_error(TwitterClient::Errors::NotFound)
end
end
end
end