Sha256: 8eec04ece6cec829c1126798732a211223e0a0fa026a1119749c0aca2b1f6899
Contents?: true
Size: 518 Bytes
Versions: 8
Compression:
Stored size: 518 Bytes
Contents
module SurveyGizmoSpec 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} result ? body.merge!(:data => data) : body.merge!(:message => data) {:headers => {'Content-Type' => 'application/json'}, :body => body.to_json} end end end
Version data entries
8 entries across 8 versions & 1 rubygems