Sha256: 0af122ba7817142c3f2485f0ab6bc817e008b580d9435c285519f7c39229ae64
Contents?: true
Size: 1.57 KB
Versions: 3
Compression:
Stored size: 1.57 KB
Contents
require File.join( File.dirname(__FILE__), "..", "spec_helper" ) require 'active_fedora' require 'active_fedora/model' require "rexml/document" require 'ftools' require 'mocha' include ActiveFedora::Model include Mocha::API describe ActiveFedora::Model do before(:each) do module ModelIntegrationSpec class Basic < ActiveFedora::Base include ActiveFedora::Model def self.pid_namespace "foo" end end end ActiveFedora::RubydoraConnection.connect(ActiveFedora.fedora_config[:url]) @test_instance = ModelIntegrationSpec::Basic.new @test_instance.save end after(:each) do @test_instance.delete Object.send(:remove_const, :ModelIntegrationSpec) end describe '#find' 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_model' do it "should return an object of the given Model whose inner object is nil" do #result = ModelIntegrationSpec::Basic.find_model(@test_instance.pid, ModelIntegrationSpec::Basic) result = ActiveFedora::RubydoraConnection.instance.find_model(@test_instance.pid, ModelIntegrationSpec::Basic) result.class.should == ModelIntegrationSpec::Basic result.inner_object.new?.should be_false end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
active-fedora-3.1.4 | spec/integration/model_spec.rb |
active-fedora-3.1.3 | spec/integration/model_spec.rb |
active-fedora-3.1.2 | spec/integration/model_spec.rb |