Sha256: 115cbc3b6f657aa4181a213e7c06d295972a640b602b0485c1400edc5778fbfe
Contents?: true
Size: 814 Bytes
Versions: 11
Compression:
Stored size: 814 Bytes
Contents
require 'spec_helper' describe Restforce::Mash do describe '#build' do subject { described_class.build(input, nil) } context 'when array' do let(:input) { [{ foo: 'hello' }, { bar: 'world' }] } it 'mashifys each child object' do subject.each { |obj| obj.should be_a Restforce::Mash } end end end describe '#klass' do subject { described_class.klass(input) } context 'when the hash has a "records" key' do let(:input) { { 'records' => nil } } it { should eq Restforce::Collection } end context 'when the hash has an "attributes" key' do let(:input) { { 'attributes' => nil } } it { should eq Restforce::SObject } end context 'else' do let(:input) { {} } it { should eq Restforce::Mash } end end end
Version data entries
11 entries across 11 versions & 1 rubygems