spec/support/methods.rb in survey-gizmo-ruby-2.0.1 vs spec/support/methods.rb in survey-gizmo-ruby-3.0.3
- old
+ new
@@ -2,19 +2,15 @@
module Methods
def stub_api_call(method, result = true)
stub_request(method, /#{@base}/).to_return(json_response(result, {}))
end
- def request_params(opts = {})
- {'user:pass' => 'test@test.com:password'}.merge(opts)
- end
-
def json_response(result, data)
- body = {result_ok: result}
+ body = { result_ok: result }
result ? body.merge!(data: data) : body.merge!(message: data)
{
- headers: {'Content-Type' => 'application/json'},
+ headers: { 'Content-Type' => 'application/json' },
body: body.to_json
}
end
end
-end
\ No newline at end of file
+end