Created
January 26, 2016 02:02
-
-
Save adelevie/39e883cd0b598b62862f to your computer and use it in GitHub Desktop.
creating some fake bids via API
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
[1] pry(main)> client.create_bid(amount: 3499, auction_id: 3) | |
=> {"bid"=> | |
{"bidder_id"=>1, | |
"auction_id"=>3, | |
"amount"=>3499, | |
"created_at"=>"2016-01-26T02:01:36+00:00", | |
"updated_at"=>"2016-01-26T02:01:36+00:00", | |
"id"=>3, | |
"bidder"=> | |
{"github_id"=>"86790", | |
"duns_number"=>"080037478", | |
"name"=>"Alan deLevie", | |
"email"=>"", | |
"sam_account"=>true, | |
"created_at"=>"2015-12-23T14:51:34+00:00", | |
"updated_at"=>"2016-01-26T01:56:24+00:00", | |
"id"=>1}}} | |
[2] pry(main)> client.create_bid(amount: 3498, auction_id: 3) | |
=> {"bid"=> | |
{"bidder_id"=>1, | |
"auction_id"=>3, | |
"amount"=>3498, | |
"created_at"=>"2016-01-26T02:01:40+00:00", | |
"updated_at"=>"2016-01-26T02:01:40+00:00", | |
"id"=>4, | |
"bidder"=> | |
{"github_id"=>"86790", | |
"duns_number"=>"080037478", | |
"name"=>"Alan deLevie", | |
"email"=>"", | |
"sam_account"=>true, | |
"created_at"=>"2015-12-23T14:51:34+00:00", | |
"updated_at"=>"2016-01-26T01:56:24+00:00", | |
"id"=>1}}} | |
[3] pry(main)> client.create_bid(amount: 3500, auction_id: 3) | |
=> {"error"=>"Bids cannot be greater than the current max bid"} | |
[4] pry(main)> client.create_bid(amount: 4000, auction_id: 3) | |
=> {"error"=>"Bid too high"} | |
[5] pry(main)> client.create_bid(amount: -4000, auction_id: 3) | |
=> {"error"=>"Bid amount out of range"} | |
[6] pry(main)> client.create_bid(amount: 1.99, auction_id: 3) | |
=> {"error"=>"Bids must be in increments of one dollar"} | |
[7] pry(main)> client.create_bid(amount: 3000, auction_id: 3) | |
=> {"bid"=> | |
{"bidder_id"=>1, | |
"auction_id"=>3, | |
"amount"=>3000, | |
"created_at"=>"2016-01-26T02:02:09+00:00", | |
"updated_at"=>"2016-01-26T02:02:09+00:00", | |
"id"=>5, | |
"bidder"=> | |
{"github_id"=>"86790", | |
"duns_number"=>"080037478", | |
"name"=>"Alan deLevie", | |
"email"=>"", | |
"sam_account"=>true, | |
"created_at"=>"2015-12-23T14:51:34+00:00", | |
"updated_at"=>"2016-01-26T01:56:24+00:00", | |
"id"=>1}}} | |
[8] pry(main)> client.create_bid(amount: "2,000", auction_id: 3) | |
=> {"bid"=> | |
{"bidder_id"=>1, | |
"auction_id"=>3, | |
"amount"=>2000, | |
"created_at"=>"2016-01-26T02:02:17+00:00", | |
"updated_at"=>"2016-01-26T02:02:17+00:00", | |
"id"=>6, | |
"bidder"=> | |
{"github_id"=>"86790", | |
"duns_number"=>"080037478", | |
"name"=>"Alan deLevie", | |
"email"=>"", | |
"sam_account"=>true, | |
"created_at"=>"2015-12-23T14:51:34+00:00", | |
"updated_at"=>"2016-01-26T01:56:24+00:00", | |
"id"=>1}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment