Sha256: 68993e73cfe58567da2e76590ad8f388c013048dbe23272b6dc2908a7abdf467

Contents?: true

Size: 828 Bytes

Versions: 7

Compression:

Stored size: 828 Bytes

Contents

require 'spec_helper'
class Foo
  include TMS::InstanceResource
  writeable_attributes :bar
  collection_attribute :blah, 'EmailMessage'
  readonly_collection_attribute :shah, 'EmailMessage'
end

describe TMS::InstanceResource do
  context "creating a new inbound messages list" do
    let(:happy_response) do
      double(:status => 201,  :body => {})
    end

    let(:client) do
      double('client', :post => happy_response)
    end


    before do
      @instance_resource = Foo.new(client)
    end

    it 'should POST' do
      @instance_resource.bar = "OMG"
      @instance_resource.post.should be_true
    end

    it 'should correctly reflect on collection resources' do
      @instance_resource.blah.class.should == TMS::EmailMessage
      @instance_resource.shah.class.should == TMS::EmailMessage
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tms_client-0.4.1 spec/instance_resource_spec.rb
tms_client-0.4.0 spec/instance_resource_spec.rb
tms_client-0.3.0 spec/instance_resource_spec.rb
tms_client-0.2.2 spec/instance_resource_spec.rb
tms_client-0.2.1 spec/instance_resource_spec.rb
tms_client-0.2.0 spec/instance_resource_spec.rb
tms_client-0.1.1 spec/instance_resource_spec.rb