spec/support/fake_wego_api.rb in wego-0.1.2 vs spec/support/fake_wego_api.rb in wego-0.1.3
- old
+ new
@@ -25,21 +25,21 @@
private
def stub_api_response(end_point, options, filename:, status: 200)
stub_request(:get, api_path(end_point, options)).
- to_return(response_with(filename: filename, status: status))
+ to_return(wego_api_response_with(filename: filename, status: status))
end
def api_path(end_point, attributes = {})
Wego::Client.new(end_point, attributes).url
end
- def response_with(filename:, status:)
- { body: fixture_file(filename), status: status }
+ def wego_api_response_with(filename:, status:)
+ { body: wego_fixture_file(filename), status: status }
end
- def fixture_file(filename)
+ def wego_fixture_file(filename)
file_name = [filename, "json"].join(".")
file_path = ["../../fixtures", file_name].join("/")
File.read(File.expand_path(file_path, __FILE__))
end