Sha256: 92b5f77756c38f9a8ea408d1a9ddcd6958e806016fb17ec0dfbf42bac0c32ef6

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

require_relative 'spec_helper'

require 'libis/services/scope/search'
require 'libis-tools'
require 'awesome_print'

describe 'Scope search service' do
  let(:credentials) { Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-test.yml') }
  let(:subject) {
    scope = Libis::Services::Scope::Search.new
    # noinspection RubyResolve
    scope.connect(credentials.scope_user, credentials.scope_passwd, credentials.scope_db)
    scope
  }

  context 'query' do

    it 'by repcode' do
      data = {
          'dc:title' => 'Archief Sint-Vincentius a Paulogenootschap, Conferentie Onze-Lieve-Vrouw van de Rozenkrans Antwerpen',
          'dc:identifier' => ['BE/942855/580 (ref.code)'],
          'dc:source' => ['BE/942855']
      }
      result = subject.query 'BE-942855-580', type: 'REPCODE'
      expect(result).to be_a(Libis::Tools::XmlDocument)
      expect(result.to_hash['dc:record']).to deep_include(data)
    end

    it 'by id' do
      data = {
          'dc:title' => 'Archief Constant Guillaume Van Crombrugghe',
          'dc:identifier' => ['BE/942855/1569 (ref.code)'],
          'dc:source' => ['BE/942855/1569']
      }
      result = subject.query '332785', type: 'ID'
      expect(result).to be_a(Libis::Tools::XmlDocument)
      expect(result.to_hash['dc:record']).to deep_include(data)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
libis-services-1.0.10 spec/scope_search_spec.rb
libis-services-1.0.7 spec/scope_search_spec.rb
libis-services-1.0.6 spec/scope_search_spec.rb
libis-services-1.0.5 spec/scope_search_spec.rb