Sha256: f2ec59c3aa29705cb9642c4154749cfcfb3dfdf51d41960b1d730c60f9fb359f

Contents?: true

Size: 887 Bytes

Versions: 33

Compression:

Stored size: 887 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Model do
  
  before(:all) do
    module SpecModel
      class Basic < ActiveFedora::Base
      end
    end
  end
  
  after(:all) do
    Object.send(:remove_const, :SpecModel)
  end
  
  describe '.solr_query_handler' do
    subject { SpecModel::Basic.solr_query_handler }
    after do
      # reset to default
      SpecModel::Basic.solr_query_handler = 'standard'
    end

    it { should eq 'standard' }

    context "when setting to something besides the default" do
      before { SpecModel::Basic.solr_query_handler = 'search' }

      it { should eq 'search' }
    end
  end

  describe ".from_class_uri" do
    subject { ActiveFedora::Model.from_class_uri(uri) }
    context "a blank string" do
      before { expect(ActiveFedora::Base.logger).to receive(:warn) }
      let(:uri) { '' }
      it { should be_nil }
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
active-fedora-9.0.8 spec/unit/model_spec.rb
active-fedora-9.5.0 spec/unit/model_spec.rb
active-fedora-9.4.3 spec/unit/model_spec.rb
active-fedora-9.4.2 spec/unit/model_spec.rb
active-fedora-9.4.1 spec/unit/model_spec.rb
active-fedora-9.4.0 spec/unit/model_spec.rb
active-fedora-9.3.0 spec/unit/model_spec.rb
active-fedora-9.2.1 spec/unit/model_spec.rb
active-fedora-9.2.0 spec/unit/model_spec.rb
active-fedora-9.2.0.rc2 spec/unit/model_spec.rb
active-fedora-9.2.0.rc1 spec/unit/model_spec.rb
active-fedora-9.1.2 spec/unit/model_spec.rb
active-fedora-9.1.1 spec/unit/model_spec.rb
active-fedora-9.1.0 spec/unit/model_spec.rb
active-fedora-9.1.0.rc1 spec/unit/model_spec.rb
active-fedora-9.0.6 spec/unit/model_spec.rb
active-fedora-9.0.5 spec/unit/model_spec.rb
active-fedora-9.0.4 spec/unit/model_spec.rb
active-fedora-9.0.3 spec/unit/model_spec.rb
active-fedora-9.0.2 spec/unit/model_spec.rb