Sha256: bec2550b561a697568c9647f9fb220454293c16309b409c43cdc264d0432c91f
Contents?: true
Size: 885 Bytes
Versions: 8
Compression:
Stored size: 885 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 end
Version data entries
8 entries across 8 versions & 1 rubygems