Sha256: 5a7131ca5c7878b89e89f5924d837d4d99de1665e20e762d63e75772e1ea886c

Contents?: true

Size: 715 Bytes

Versions: 10

Compression:

Stored size: 715 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

10 entries across 10 versions & 1 rubygems

Version Path
active-fedora-9.5.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.4.3 spec/unit/collection_proxy_spec.rb
active-fedora-9.4.2 spec/unit/collection_proxy_spec.rb
active-fedora-9.4.1 spec/unit/collection_proxy_spec.rb
active-fedora-9.4.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.3.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.2.1 spec/unit/collection_proxy_spec.rb
active-fedora-9.2.0 spec/unit/collection_proxy_spec.rb
active-fedora-9.2.0.rc2 spec/unit/collection_proxy_spec.rb
active-fedora-9.2.0.rc1 spec/unit/collection_proxy_spec.rb