Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Created October 5, 2016 13:09
Show Gist options
  • Save thiagoa/96afb2e3f3e1a0337c8c3de9942e978c to your computer and use it in GitHub Desktop.
Save thiagoa/96afb2e3f3e1a0337c8c3de9942e978c to your computer and use it in GitHub Desktop.
When the timeline is not found
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