Sha256: 0a0668b8ea669166edc17a27081e995fa76bc6df86aeec693c6d0cc47e9f940f

Contents?: true

Size: 990 Bytes

Versions: 4

Compression:

Stored size: 990 Bytes

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
    @posting_client.exists_posting(mock("")).should be_true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
threetaps-client-1.0.2 spec/client/posting_client_spec.rb
threetaps-client-1.0.1 spec/client/posting_client_spec.rb
threetaps-client-1.0.0 spec/client/posting_client_spec.rb
threetaps-client-0.5.1 spec/client/posting_client_spec.rb