Sha256: c71ad4aca892af032c7aeeec1b0f54608d62b7dbde041191b223e7c301414d13

Contents?: true

Size: 674 Bytes

Versions: 26

Compression:

Stored size: 674 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Associations::HasManyAssociation do
  it "should call add_relationship" do
    subject = double("subject", :new_record? => false, :pid => 'subject:a', :internal_uri => 'info:fedora/subject:a')
    predicate = double(:klass => double.class, :options=>{:property=>'predicate'}, :class_name=> nil)
    ActiveFedora::SolrService.stub(:query).and_return([])
    ac = ActiveFedora::Associations::HasManyAssociation.new(subject, predicate)
    object = double("object", :new_record? => false, :pid => 'object:b', :save => nil)
  
    object.should_receive(:add_relationship).with('predicate', subject)
 
    ac << object

  end
  
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
active-fedora-6.7.8 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.7 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.6 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.5 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.4 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.3 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.2 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.1 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.0 spec/unit/has_many_collection_spec.rb
active-fedora-6.7.0.rc1 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.1 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.rc5 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.rc4 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.rc3 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.rc2 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.rc1 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.pre4 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.pre3 spec/unit/has_many_collection_spec.rb
active-fedora-6.6.0.pre2 spec/unit/has_many_collection_spec.rb