Skip to content

Instantly share code, notes, and snippets.

@ianks
Created June 16, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianks/bea4853219f2493f48a01ca71cff3140 to your computer and use it in GitHub Desktop.
Save ianks/bea4853219f2493f48a01ca71cff3140 to your computer and use it in GitHub Desktop.
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