Sha256: 8d32b0c9f2f42f4cdddc112d3d60964def631a7fdf55ca102eb40a6c0461cb7b

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe CatalogController do
  it "has a Blacklight module" do
    expect(Blacklight).to be_a_kind_of Module
  end

  it 'has blacklight configuration' do
    expect(described_class.blacklight_config).to be_a_kind_of Blacklight::Configuration
  end

  describe '#oai' do
    it 'responds to oai' do
      expect(controller).to respond_to :oai
    end
  end

  describe '#oai_config' do
    it 'returns correct provider configuration' do
      expect(controller.oai_config).to include(
        provider: {
          repository_name: "Test Repository",
          repository_url: "http://localhost/catalog/oai",
          record_prefix: "oai:test",
          admin_email: "root@localhost",
          deletion_support: "persistent",
          sample_id: "109660"
        }
      )
    end

    it 'return corrext document configuration' do
      expect(controller.oai_config[:document][:limit]).to be 25
      expect(controller.oai_config[:document][:model]).to be_a Class
    end
  end

  describe '#oai_provider' do
    it 'returns BlacklightOaiProvider::SolrDocumentProvider' do
      expect(controller.oai_provider).to be_a BlacklightOaiProvider::SolrDocumentProvider
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight_oai_provider-5.0.0 spec/controllers/catalog_controller_spec.rb
blacklight_oai_provider-5.0.0.pre1 spec/controllers/catalog_controller_spec.rb