Sha256: 9b0c9fac42556a4d4b64157a730f8e8185ed67177a3a37a5fa37dc050fa75bc9

Contents?: true

Size: 710 Bytes

Versions: 13

Compression:

Stored size: 710 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Associations::CollectionProxy do
  before do
    class Book < ActiveFedora::Base
    end
    class Page < ActiveFedora::Base
    end
  end

  after do
    Object.send(:remove_const, :Page)
    Object.send(:remove_const, :Book)
  end

  describe "#spawn" do
    let(:reflection)  { Book.create_reflection(:has_many, :pages, { predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection }, Book) }
    let(:association) { ActiveFedora::Associations::HasManyAssociation.new(Book.new, reflection) }
    let(:proxy)       { described_class.new(association) }

    subject { proxy.spawn }
    it { is_expected.to be_instance_of ActiveFedora::Relation }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active-fedora-9.7.3 spec/unit/collection_proxy_spec.rb
active-fedora-9.7.2 spec/unit/collection_proxy_spec.rb
active-fedora-9.10.0.pre2 spec/unit/collection_proxy_spec.rb
active-fedora-9.10.0.pre1 spec/unit/collection_proxy_spec.rb
active-fedora-9.9.1 spec/unit/collection_proxy_spec.rb
active-fedora-9.9.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.8.2 spec/unit/collection_proxy_spec.rb
active-fedora-9.8.1 spec/unit/collection_proxy_spec.rb
active-fedora-9.8.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.7.1 spec/unit/collection_proxy_spec.rb
active-fedora-9.7.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.6.2 spec/unit/collection_proxy_spec.rb
active-fedora-9.6.1 spec/unit/collection_proxy_spec.rb