spec/support/methods.rb in survey-gizmo-ruby-1.0.5 vs spec/support/methods.rb in survey-gizmo-ruby-2.0.0

- old
+ new

@@ -3,15 +3,18 @@ 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) + {'user:pass' => 'test@test.com:password'}.merge(opts) end def json_response(result, data) - body = {:result_ok => result} - result ? body.merge!(:data => data) : body.merge!(:message => data) - {:headers => {'Content-Type' => 'application/json'}, :body => body.to_json} + body = {result_ok: result} + result ? body.merge!(data: data) : body.merge!(message: data) + { + headers: {'Content-Type' => 'application/json'}, + body: body.to_json + } end end end \ No newline at end of file