Sha256: 9dc6ba7de043f25ffcd483d3d6bcd37df8a6b41c7501b93ad174e9e46405df18
Contents?: true
Size: 429 Bytes
Versions: 36
Compression:
Stored size: 429 Bytes
Contents
module SurveyGizmoSpec module Methods def stub_api_call(method, result = true) stub_request(method, /#{@base}/).to_return(json_response(result, {})) 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
36 entries across 36 versions & 1 rubygems