Sha256: 2411453b723b23c3fcd8e9a183f6e2288a38cff003b34088408f3a6e0d86ebc8

Contents?: true

Size: 1.44 KB

Versions: 20

Compression:

Stored size: 1.44 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
      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
      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 = 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

20 entries across 20 versions & 1 rubygems

Version Path
active-fedora-3.1.1 spec/integration/model_spec.rb
active-fedora-3.1.0 spec/integration/model_spec.rb
active-fedora-3.1.0.rc4 spec/integration/model_spec.rb
active-fedora-3.1.0.rc3 spec/integration/model_spec.rb
active-fedora-3.1.0.rc2 spec/integration/model_spec.rb
active-fedora-3.1.0.rc1 spec/integration/model_spec.rb
active-fedora-3.1.0.pre14 spec/integration/model_spec.rb
active-fedora-3.1.0.pre13 spec/integration/model_spec.rb
active-fedora-3.1.0.pre12 spec/integration/model_spec.rb
active-fedora-3.1.0.pre11 spec/integration/model_spec.rb
active-fedora-3.1.0.pre10 spec/integration/model_spec.rb
active-fedora-3.1.0.pre9 spec/integration/model_spec.rb
active-fedora-3.1.0.pre8 spec/integration/model_spec.rb
active-fedora-3.1.0.pre7 spec/integration/model_spec.rb
active-fedora-3.1.0.pre6 spec/integration/model_spec.rb
active-fedora-3.1.0.pre5 spec/integration/model_spec.rb
active-fedora-3.1.0.pre4 spec/integration/model_spec.rb
active-fedora-3.1.0.pre3 spec/integration/model_spec.rb
active-fedora-3.1.0.pre2 spec/integration/model_spec.rb
active-fedora-3.1.0.pre1 spec/integration/model_spec.rb