Sha256: 80a560bc7a6e150203c11e46b6e33c5a44bdddd94452444ec8254382e7a6c4c1

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe StorageRoom::Collection do
  context "Class" do
    context "Methods" do
      describe "#show_path" do
        it "should be defined" do
          StorageRoom::Collection.show_path(1).should == '/collections/1'
        end
      end
      
      describe "#index_path" do
        it "should be defined" do
          StorageRoom::Collection.index_path.should == '/collections'
        end
      end
      
      describe "#entries_path" do
        it "should be defined" do
          StorageRoom::Collection.entries_path(1).should == '/collections/1/entries'
        end
      end
      
      describe "#json_name" do
        it "should be defined" do
          StorageRoom::Collection.json_name.should == 'collection'
        end
      end
    end
    
  end
  
  context "Instance" do
    before(:each) do
      @collection = StorageRoom::Collection.new
    end
    
    describe "#entries" do
      it "should load" do
        StorageRoom::Array.should_receive(:load)
        @collection.entries
      end
    end
    
    describe "#entry_class" do
      it "should return class" do
        @collection[:name] = 'guidebook'
        klass = @collection.entry_class
        klass.should == Guidebook
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
storage_room-0.2.1 spec/storage_room/models/collection_spec.rb
storage_room-0.2.0 spec/storage_room/models/collection_spec.rb