Sha256: 820b7f1f6f06c835b296b0ffacf27f6489fd7392b6e70f37bfa999963ad0888b
Contents?: true
Size: 602 Bytes
Versions: 8
Compression:
Stored size: 602 Bytes
Contents
require 'spec_helper' describe Mashery::RpcClient do let(:query) { "SELECT * FROM whatevers" } let(:params) { { 'method' => "object.query", 'params' => [query], 'id' => 1 } } let(:headers) { { "Content-Type" => "application/json", "Accept" => "text/plain", "Content-Length" => params.size } } it "should post to RpcClient with the proper arguments" do ::RestClient.should_receive(:post).with(Mashery.rpc.url, params.to_json, headers).and_return({hello: 'world'}.to_json) Mashery.rpc.query(query) end end
Version data entries
8 entries across 8 versions & 1 rubygems