Sha256: a8442027ff328902eb70751b97a1e118a100a0642f6516fcf833170e8c06ea1e

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe Qa::LinkedData::AuthorityService do
  let(:auth_names) do
    [:LOC,
     :LOD_ENCODING_CONFIG,
     :LOD_FULL_CONFIG,
     :LOD_FULL_CONFIG_1_0,
     :LOD_LANG_DEFAULTS,
     :LOD_LANG_MULTI_DEFAULTS,
     :LOD_LANG_NO_DEFAULTS,
     :LOD_LANG_PARAM,
     :LOD_MIN_CONFIG,
     :LOD_SEARCH_ONLY_CONFIG,
     :LOD_SORT,
     :LOD_TERM_ID_PARAM_CONFIG,
     :LOD_TERM_ONLY_CONFIG,
     :LOD_TERM_URI_PARAM_CONFIG,
     :OCLC_FAST]
  end

  describe '#authority_configs' do
    let(:result) { described_class.authority_configs }
    it 'returns all authorities' do
      expect(result).to be_kind_of(Hash)
      expect(result.keys).to match_array auth_names
      expect(result.values.first).to be_kind_of(Hash)
      expect(result.values.first).to have_key(:term)
      expect(result.values.first).to have_key(:search)
    end
  end

  describe '#authority_config' do
    let(:result) { described_class.authority_config(:LOD_FULL_CONFIG) }
    it 'returns a single authority' do
      expect(result).to be_kind_of(Hash)
      expect(result).to have_key(:term)
      expect(result).to have_key(:search)
    end
  end

  describe '#authority_names' do
    it "returns a list of all authorities' names" do
      expect(described_class.authority_names).to eq auth_names
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qa-4.0.0 spec/lib/authorities/linked_data/authority_service_spec.rb
qa-4.0.0.rc3 spec/lib/authorities/linked_data/authority_service_spec.rb
qa-4.0.0.rc2 spec/lib/authorities/linked_data/authority_service_spec.rb
qa-4.0.0.rc1 spec/lib/authorities/linked_data/authority_service_spec.rb