Sha256: 3a55780d11c5bc82d2e3639f39c4c86ca6314cc5df13399638f88003530f5e7a

Contents?: true

Size: 776 Bytes

Versions: 11

Compression:

Stored size: 776 Bytes

Contents

require 'spec_helper'

describe StorageRoom::AssociationField do
  before(:each) do
    @field = StorageRoom::AssociationField.new(:collection_url => 'URL')
  end
  
  context "Configuration" do
    it "should have keys" do
      keys = StorageRoom::AssociationField.attribute_options_including_superclasses.keys
      
      [:collection_url].each do |key|
        keys.should include(key)
      end
    end
  end
  
  context "Methods" do
    describe "#collection" do
      it "should return collection" do
        collection = StorageRoom::Collection.new
        StorageRoom::Collection.stub(:load).and_return(collection)
        StorageRoom::Collection.should_receive(:load).with('URL')
        
        @field.collection.should == collection
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
storage_room-0.3.24 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.23 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.22 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.21 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.20 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.19 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.18 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.17 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.16 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.15 spec/storage_room/embeddeds/fields/association_field_spec.rb
storage_room-0.3.14 spec/storage_room/embeddeds/fields/association_field_spec.rb