osrm-backend/features/step_definitions/requests.rb

24 lines
518 B
Ruby

When /^I request \/(.*)$/ do |path|
reprocess
OSRMLauncher.new do
@response = request_path path
end
end
Then /^I should get a response/ do
@response.code.should == "200"
@response.body.should_not == nil
@response.body.should_not == ''
end
Then /^response should be valid JSON$/ do
@json = JSON.parse @response.body
end
Then /^response should be well-formed$/ do
@json['version'].class.should == Float
@json['status'].class.should == Fixnum
@json['transactionId'].class.should == String
end