Sha256: 9ccd42e5d01f591e5075d23136c276a0403cae75868758c5417297d12811d6e7

Contents?: true

Size: 598 Bytes

Versions: 1

Compression:

Stored size: 598 Bytes

Contents

require 'spec_helper'

describe ButterCMS::ButterCollection do
  let(:json) { {"data" => ["foo"], "meta" => {}} }
  let(:klass) { double('klass', :new => 'bar') }

  it 'implements #items' do
    collection = ButterCMS::ButterCollection.new(klass, json)

    expect(collection.items).to match_array(["bar"])
  end

  it 'implements #meta' do
    collection = ButterCMS::ButterCollection.new(klass, json)

    expect(collection.meta).to be_a(OpenStruct)
  end

  it 'implements #count' do
    collection = ButterCMS::ButterCollection.new(klass, json)

    expect(collection.count).to eq 1
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
buttercms-ruby-1.6 spec/lib/buttercms/butter_collection_spec.rb