Sha256: 55fc6572beee9eb7be8c405adbf36f0a2edc2b1bed8936c59ccd07e0c0e57c1c

Contents?: true

Size: 1.36 KB

Versions: 22

Compression:

Stored size: 1.36 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::Standalone

describe ActiveFedora::Model do
  
  
  before(:each) do 
    module ModelIntegrationSpec
      
      class Basic < ActiveFedora::Base
        include ActiveFedora::Model
      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
    it "should return an array of instances of the calling Class" do
      pending
      result = ModelIntegrationSpec::Basic.find(:all)
      result.should be_instance_of(Array)
      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 = Fedora::Repository.instance.find_model(@test_instance.pid, ModelIntegrationSpec::Basic)
      result.class.should == ModelIntegrationSpec::Basic
      result.inner_object.new_object?.should be_false
    end
  end
  
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
active-fedora-2.3.1 spec/integration/model_spec.rb
active-fedora-2.3.0 spec/integration/model_spec.rb
active-fedora-2.2.3 spec/integration/model_spec.rb
active-fedora-2.2.2 spec/integration/model_spec.rb
active-fedora-2.2.1 spec/integration/model_spec.rb
active-fedora-2.2.0 spec/integration/model_spec.rb
active-fedora-2.1.0 spec/integration/model_spec.rb
active-fedora-2.0.4 spec/integration/model_spec.rb
active-fedora-2.0.3 spec/integration/model_spec.rb
active-fedora-2.0.2 spec/integration/model_spec.rb
active-fedora-2.0.1 spec/integration/model_spec.rb
active-fedora-2.0.0 spec/integration/model_spec.rb
active-fedora-1.2.9 spec/integration/model_spec.rb
active-fedora-1.2.8 spec/integration/model_spec.rb
active-fedora-1.2.7 spec/integration/model_spec.rb
active-fedora-1.2.6 spec/integration/model_spec.rb
active-fedora-1.2.5 spec/integration/model_spec.rb
active-fedora-1.2.4 spec/integration/model_spec.rb
active-fedora-1.2.3 spec/integration/model_spec.rb
active-fedora-1.2.2 spec/integration/model_spec.rb