Sha256: 7d4b73d5ea9b9c25010a2c1dedc2940d44c9dd9506094435389aae57b7b93f60
Contents?: true
Size: 1.24 KB
Versions: 33
Compression:
Stored size: 1.24 KB
Contents
require 'spec_helper' describe ActiveFedora::Base do describe ".update_index" do before do mock_conn = double("SolrConnection") expect(mock_conn).to receive(:add) do |_, opts| expect(opts).to eq(:params=>{:softCommit=>true}) end mock_ss = double("SolrService") allow(mock_ss).to receive(:conn).and_return(mock_conn) allow(ActiveFedora::SolrService).to receive(:instance).and_return(mock_ss) end it "should make the solr_document with to_solr and add it" do expect(subject).to receive(:to_solr) subject.update_index end end describe ".delete" do before do allow(subject).to receive(:new_record?).and_return(false) allow(ActiveFedora.fedora.connection).to receive(:delete) end it "should delete object from repository and index" do expect(ActiveFedora::SolrService).to receive(:delete).with(nil) subject.delete end end describe "to_class_uri" do before :all do module SpecModel class CamelCased < ActiveFedora::Base end end end after :all do SpecModel.send(:remove_const, :CamelCased) end subject {SpecModel::CamelCased.to_class_uri} it { should == 'SpecModel::CamelCased' } end end
Version data entries
33 entries across 33 versions & 1 rubygems