cuke testing of timestamp api
This commit is contained in:
@@ -61,6 +61,7 @@ Given /^the preprocessed files for "([^"]*)" are present and up to date$/ do |ar
|
||||
File.exists?("#{area}.osrm.edges").should == true
|
||||
File.exists?("#{area}.osrm.ramIndex").should == true
|
||||
File.exists?("#{area}.osrm.fileIndex").should == true
|
||||
File.exists?("#{area}.osrm.tiemstamp").should == true
|
||||
end
|
||||
|
||||
Then /^I should see the file "([^"]*)"$/ do |file|
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
When /^I request \/(.*)$/ do |path|
|
||||
osrm_kill
|
||||
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
|
||||
|
||||
@@ -12,25 +12,13 @@ When /^I request a route from "([^"]*)" to "([^"]*)"$/ do |a,b|
|
||||
@response = request_route "#{locations[a][0]},#{locations[a][1]}", "#{locations[b][0]},#{locations[b][1]}"
|
||||
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
|
||||
Then /^response should be a well-formed route$/ do
|
||||
step "response should be well-formed"
|
||||
@json['status_message'].class.should == String
|
||||
@json['route_summary'].class.should == Hash
|
||||
@json['route_geometry'].class.should == String
|
||||
@json['route_instructions'].class.should == Array
|
||||
@json['via_points'].class.should == Array
|
||||
@json['transactionId'].class.should == String
|
||||
end
|
||||
|
||||
Then /^a route should be found$/ do
|
||||
@@ -46,7 +34,7 @@ end
|
||||
Then /^I should get a valid response$/ do
|
||||
step "I should get a response"
|
||||
step "response should be valid JSON"
|
||||
step "response should be well-formed"
|
||||
step "response should be a well-formed route"
|
||||
#step "no error should be reported in terminal"
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Then /^I should get a valid timestamp/ do
|
||||
step "I should get a response"
|
||||
step "response should be valid JSON"
|
||||
step "response should be well-formed"
|
||||
@json['timestamp'].class.should == String
|
||||
@json['timestamp'].should == OSM_TIMESTAMP
|
||||
end
|
||||
Reference in New Issue
Block a user