Last active
October 10, 2016 16:47
-
-
Save thiagoa/660c0f0f4829bd516005f4aaf115ef50 to your computer and use it in GitHub Desktop.
Twitter timeline hub spec when the timeline is forbidden
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 forbidden' do | |
it 'returns a result with no tweets and forbidden status' do | |
twitter_client = double('twitter_client') | |
allow(twitter_client).to receive(:user_timeline) | |
.with('screen_name', count: 5) | |
.once { fail Twitter::Error::Unauthorized } | |
twitter_timeline_hub = TwitterTimelineHub.new(twitter_client) | |
result = twitter_timeline_hub.call('screen_name', count: 5) | |
expect(result.status).to eq :forbidden | |
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