Sha256: e2ee3c4eeb1b6ab7bafe901ed076259f6f0c6948e310f6c55163ad1710d2f635
Contents?: true
Size: 1.91 KB
Versions: 8
Compression:
Stored size: 1.91 KB
Contents
require 'spec_helper' describe ActiveFedora::Model do before(:each) do module ModelIntegrationSpec class Base < ActiveFedora::Base include ActiveFedora::Model def self.pid_namespace "foo" end end class Basic < Base end end @test_instance = ModelIntegrationSpec::Basic.new @test_instance.save end after(:each) do @test_instance.delete Object.send(:remove_const, :ModelIntegrationSpec) end describe '#find' do describe "with :all" do it "should return an array of instances of the calling Class" do result = ModelIntegrationSpec::Basic.find(:all) result.should be_instance_of(Array) # this test is meaningless if the array length is zero result.length.should > 0 result.each do |obj| obj.class.should == ModelIntegrationSpec::Basic end end end describe "#find with a valid pid with cast" do subject { ActiveFedora::Base.find('test:fixture_mods_article1', :cast=>true) } it { should be_instance_of ModsArticle} end describe "#find with a valid pid without cast" do subject { ActiveFedora::Base.find('test:fixture_mods_article1') } it { should be_instance_of ActiveFedora::Base} end end describe "#load_instance_from_solr" do describe "with a valid pid" do subject { ActiveFedora::Base.load_instance_from_solr('test:fixture_mods_article1') } it { should be_instance_of ModsArticle} end describe "with metadata datastream spec" do subject { ActiveFedora::Base.load_instance_from_solr('test:fixture_mods_article1') } it "should create an xml datastream" do subject.datastreams['properties'].should be_kind_of ActiveFedora::SimpleDatastream end it "should know the datastreams properties" do subject.properties.dsSize.should == 19 end end end end
Version data entries
8 entries across 8 versions & 1 rubygems