Sha256: 64f4e16d6dd4fb7035a5a4f81e02b470785a8e1f597fdda07f13c5a2c657b8f8

Contents?: true

Size: 1.17 KB

Versions: 16

Compression:

Stored size: 1.17 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe StatusClient do
  before(:each) do
    @status_client = StatusClient.new
  end

  it "should send POST request and create Message from result" do
    stub_post_and_json_decode
    posting = mock "posting"
    message = mock "message"
    status_update_request = mock "status_update_request"
    Message.should_receive(:new).and_return message
    posting.should_receive(:status).and_return status_update_request
    status_update_request.should_receive(:event).and_return ""

    @status_client.update_status(posting).should == message
  end

  it "should send POST request and create GetResponse from result" do
    stub_post_and_json_decode
    postings = mock "posting"
    postings.should_receive(:to_json_for_status_client)
    array = mock "array"
    GetStatusResponse.should_receive(:from_array).and_return array

    @status_client.get_status(postings).should == array
  end

  it "should send GET request and create Message from result" do
    stub_get_and_json_decode
    message = mock "message"
    Message.should_receive(:new).and_return message

    @status_client.system_status.should == message
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 spec/client/status_client_spec.rb
threetaps-client-1.0.13 spec/client/status_client_spec.rb
threetaps-client-1.0.12 spec/client/status_client_spec.rb
threetaps-client-1.0.11 spec/client/status_client_spec.rb
threetaps-client-1.0.10 spec/client/status_client_spec.rb
threetaps-client-1.0.9 spec/client/status_client_spec.rb
threetaps-client-1.0.8 spec/client/status_client_spec.rb
threetaps-client-1.0.7 spec/client/status_client_spec.rb
threetaps-client-1.0.6 spec/client/status_client_spec.rb
threetaps-client-1.0.5 spec/client/status_client_spec.rb
threetaps-client-1.0.4 spec/client/status_client_spec.rb
threetaps-client-1.0.3 spec/client/status_client_spec.rb
threetaps-client-1.0.2 spec/client/status_client_spec.rb
threetaps-client-1.0.1 spec/client/status_client_spec.rb
threetaps-client-1.0.0 spec/client/status_client_spec.rb
threetaps-client-0.5.1 spec/client/status_client_spec.rb