diff --git a/lib/resources/workers.rb b/lib/resources/workers.rb index c981135..e9375a6 100644 --- a/lib/resources/workers.rb +++ b/lib/resources/workers.rb @@ -73,7 +73,7 @@ def set_schedule(config, id, body) Onfleet.request(config, method.to_sym, path, body.to_json) end - def get_delivery_manifest(config, body, google_api_key, query_parameters_hash) + def get_delivery_manifest(config, body, google_api_key = nil, query_parameters_hash = nil) method = 'post' query_parameters = nil diff --git a/lib/test/test_data.json b/lib/test/test_data.json index 2686a37..4ae563d 100644 --- a/lib/test/test_data.json +++ b/lib/test/test_data.json @@ -1997,9 +1997,9 @@ ] } }, - "getManifestProvider": { + "get_delivery_manifest": { "request": { - "path": "providers/manifest/generate?hubId=&workerId=", + "path": "providers/manifest/generate?hubId=kyfYe*wyVbqfomP2HTn5dAe1&workerId=kBUZAb7pREtRn*8wIUCpjnPu", "method": "GET" }, "response": { diff --git a/lib/test/test_onfleet.rb b/lib/test/test_onfleet.rb index d8b1831..7fc04ca 100644 --- a/lib/test/test_onfleet.rb +++ b/lib/test/test_onfleet.rb @@ -15,6 +15,9 @@ require_relative '../resources/webhooks' require_relative '../resources/workers' +# WebMock blocks HTTP requests in integration tests, but you can either stub the request or call WebMock.allow_net_connect! to configure the tests to run as normal. +WebMock.allow_net_connect! + # RSpec configuration setup for unit tests RSpec.configure do |config| file = File.read('./test_data.json') @@ -22,7 +25,7 @@ config.test_data = JSON.parse(file) config.add_setting :api_variables - config.api_variables = Onfleet::Configuration.new("f70dd381f0366c721677fb7e088b83bd","https://staging.onfleet.com/api/v2") + config.api_variables = Onfleet::Configuration.new("f70dd381f0366c721677fb7e088b83bd","https://stable1.onfleet.com/api/v2") end # Administrator entity tests