spec/integration/relation_spec.rb in active-fedora-8.7.0 vs spec/integration/relation_spec.rb in active-fedora-9.0.0.beta1

- old
+ new

@@ -1,24 +1,26 @@ require 'spec_helper' describe ActiveFedora::Base do before :all do - class Library < ActiveFedora::Base - has_many :books, property: :has_member + class Library < ActiveFedora::Base + has_many :books, predicate: ActiveFedora::RDF::RelsExt.isPartOf end class Book < ActiveFedora::Base; end end after :all do - Library.delete_all Object.send(:remove_const, :Library) Object.send(:remove_const, :Book) end - subject { Library.all } - its(:class) {is_expected.to eq ActiveFedora::Relation } + subject { Library.all } - before :all do + it "should be a relation" do + expect(subject.class).to be ActiveFedora::Relation + end + + before :each do Library.create @library = Library.create end let(:library1) { @library } @@ -30,10 +32,10 @@ it "should be loaded" do expect(subject).to be_loaded end it "shouldn't reload" do - expect_any_instance_of(ActiveFedora::Relation).not_to receive :find_each + expect_any_instance_of(ActiveFedora::Relation).to_not receive :find_each subject[0] end end describe "#find" do