Sha256: 7fd7bbd27cb3ad502a89c3badf35772b14f09b96a4c5894943f103e2ee8ff524

Contents?: true

Size: 983 Bytes

Versions: 2

Compression:

Stored size: 983 Bytes

Contents

RSpec.describe ActiveFedora::Base do

  describe ".find" do
    let!(:collection) { FactoryGirl.create(:collection) }
    describe "when called on the wrong class" do
      it "should raise an exception" do
        expect { Item.find(collection.pid) }.to raise_error(Ddr::Models::ContentModelError)
      end
    end
    describe "when called on Ddr::Models::Base" do
      it "should cast to the object's class" do
        expect(Ddr::Models::Base.find(collection.pid)).to eq(collection)
      end
    end
    describe "when called on ActiveFedora::Base" do
      it "should cast to the object's class" do
        expect(ActiveFedora::Base.find(collection.pid)).to eq(collection)
      end
    end
    describe "when called on the object's class" do
      it "should return the object" do
        expect(Collection.find(collection.pid)).to eq(collection)
      end
    end
  end

  its(:can_be_streamable?) { is_expected.to be false }
  it { is_expected.not_to be_streamable }

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddr-models-2.8.0 spec/models/active_fedora_base_spec.rb
ddr-models-2.8.0.rc1 spec/models/active_fedora_base_spec.rb