Created
October 5, 2016 13:09
-
-
Save thiagoa/96afb2e3f3e1a0337c8c3de9942e978c to your computer and use it in GitHub Desktop.
When the timeline is not found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context 'when the timeline is not found' do | |
it 'returns a result with no tweets and not_found status' do | |
twitter_client = instance_double(Twitter::REST::Client) | |
allow(twitter_client).to receive(:user_timeline) | |
.with('screen_name', count: 5) | |
.once { fail Twitter::Error::NotFound } | |
twitter_hub = TwitterTimelineHub.new(twitter_client) | |
result = twitter_hub.call('screen_name', count: 5) | |
expect(result.status).to eq :not_found | |
expect(result.tweets).to be_empty | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment