Sha256: d8c8001209c735f0fd4eb5a9dce7fe181a5cfae830d73ca788a44646c2061d9a

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 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'],
          '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'],
          '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.1.0 spec/scope_search_spec.rb
libis-services-1.0.13 spec/scope_search_spec.rb
libis-services-1.0.12 spec/scope_search_spec.rb
libis-services-1.0.11 spec/scope_search_spec.rb