Sha256: 99f0b5bc62c6f086133e7e678dd0d0bde47dbf77d98ad421b0840cb000e280fd

Contents?: true

Size: 670 Bytes

Versions: 16

Compression:

Stored size: 670 Bytes

Contents

require 'spec_helper'

describe ActionKitRest::Response::Wrapper do
  describe 'initialization' do
    it "should be kind 'object' for objects" do
      body = double
      response = double(:body => body)

      wrapper = ActionKitRest::Response::Wrapper.new(response)

      wrapper.object?.should be_truthy
      wrapper.collection?.should be_falsey
    end

    it "should be kind 'collection' for collections" do
      body = double(:meta => '', :objects => [])
      response = double(:body => body)

      wrapper = ActionKitRest::Response::Wrapper.new(response)

      wrapper.object?.should be_falsey
      wrapper.collection?.should be_truthy
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
action_kit_rest-0.4.4 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.4.3 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.4.2 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.4.1 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.4.0 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.8 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.7 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.6 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.5 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.4 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.3 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.2 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.1 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.3.0 spec/lib/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.2.2 spec/action_kit_rest/response/wrapper_spec.rb
action_kit_rest-0.2.1 spec/action_kit_rest/response/wrapper_spec.rb