spec/support/fake_wego_api.rb in wego-0.1.3 vs spec/support/fake_wego_api.rb in wego-0.1.4

- old
+ new

@@ -9,12 +9,23 @@ def stub_search_results_api(search_id, options = {}) stub_api_response("search/#{search_id}", options, filename: "results") end - def stub_search_result_api(search_id:, hotel_id:) + def stub_search_result_api(search_id:, hotel_id:, **options) stub_api_response( - "search/#{search_id}", { hotel_id: hotel_id }, filename: "result" + "search/#{search_id}", + options.merge(hotel_id: hotel_id), + filename: "result" + ) + end + + def stub_invalid_search_result_api(search_id:, hotel_id:, **options) + stub_api_response( + "search/#{search_id}", + options.merge(hotel_id: hotel_id), + filename: "error", + status: 400 ) end def stub_invalid_api_response(status: 404) stub_api_response(