Skip to content

Commit

Permalink
Merge pull request #15 from onfleet/INT-1310-ruby-onfleet-fix-tests
Browse files Browse the repository at this point in the history
Int 1310 ruby onfleet fix tests
  • Loading branch information
lisandrobigi-onfleet authored Jun 26, 2024
2 parents 6257836 + 6eb92c3 commit 3865b6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/resources/workers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/test/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1997,9 +1997,9 @@
]
}
},
"getManifestProvider": {
"get_delivery_manifest": {
"request": {
"path": "providers/manifest/generate?hubId=<hubId>&workerId=<workerId>",
"path": "providers/manifest/generate?hubId=kyfYe*wyVbqfomP2HTn5dAe1&workerId=kBUZAb7pREtRn*8wIUCpjnPu",
"method": "GET"
},
"response": {
Expand Down
5 changes: 4 additions & 1 deletion lib/test/test_onfleet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
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')
config.add_setting :test_data
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
Expand Down

0 comments on commit 3865b6d

Please sign in to comment.