Created
June 16, 2017 19:04
-
-
Save ianks/bea4853219f2493f48a01ca71cff3140 to your computer and use it in GitHub Desktop.
This file contains 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
it 'makes two requests to resolve the users when necessary' do | |
current_page = 1 | |
expectation_mutex = Mutex.new | |
expect(client).to receive(:fetch_users).exactly(2).times do |args| | |
expect(args).to eql(current_page) | |
current_page += 1 | |
{ | |
'users' => build_list(:some_api_users, 10), | |
} | |
end | |
client = SomeAPI.new | |
client.fetch_users | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment