Sha256: 154e0d1d232d3da919188732ce446b2c6e0708aaaf121f0859f1cdac7e6c5127
Contents?: true
Size: 784 Bytes
Versions: 9
Compression:
Stored size: 784 Bytes
Contents
Given /^I setup my capture service$/ do mock.reset end When /^I make (\d+) posts$/ do |number| number.to_i.times.each do app.post '/test_post', '{"reservation": "yes"}' end end Then /^the service has received (\d+) posts(?:s?)$/ do |number| mock.request_log('/test_post').count.should == number.to_i end When /^I do a (.*?) on "(.*?)"$/ do |method, endpoint| app.send method.downcase, endpoint, '{"payload": "2tons"}' end Then(/^the service has recieved a request on "(.*?)"$/) do |endpoint| mock.request_log(endpoint).count.should be > 0 end When /^the headers for the request on "(.*?)" should contain:$/ do |endpoint, table| headers = mock.request_log(endpoint).first.headers table.rows_hash.each do |key, value| headers[key].should == value end end
Version data entries
9 entries across 9 versions & 1 rubygems