Sha256: 1304ba2d928f684b8cc420c99bcd72ea89b0496d6a161c8b458b2f4943cad2ae
Contents?: true
Size: 1.13 KB
Versions: 12
Compression:
Stored size: 1.13 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe PostingClient do before(:all) do end before(:each) do @posting_client = PostingClient.new end it "should return Posting object" do stub_get_and_json_decode @posting_client.get_posting("").is_a?(Posting).should be_true end # no spec for creation - see tests it "should return UpdateResponse object" do stub_post_and_json_decode UpdateResponse.should_receive(:from_hash).with([]) post = mock "Posting" , :to_json_for_update=>"" @posting_client.update_posting(post).class == UpdateResponse.class#).should be_true end it "should return DeleteResponse object" do stub_post_and_json_decode DeleteResponse.should_receive(:from_hash).with([]) @posting_client.delete_posting("").class == DeleteResponse.class end it "should return boolean value" do stub_post_and_json_decode ExistsResponse.stub!(:new).and_return mock("ExistsResponse", :exists => true) ExistsResponse.should_receive(:new).with(nil) @posting_client.exists_posting(mock("Posting", :to_json_for_status=>"")).exists.should be_true end end
Version data entries
12 entries across 12 versions & 1 rubygems