Sha256: 92e4c268bd2cb93438e32a8d7797e2bb605a3e9e4d6e0b900626c5c029a70c20

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
require_relative 'spec_helper'
require 'yaml'

require 'libis/tools/config_file'
require 'libis/services/rosetta/sip_handler'

describe 'Rosetta SIP Service' do

  let(:credentials) { Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-test.yml') }

  subject(:sip_handler) do
    # noinspection RubyResolve
    Libis::Services::Rosetta::SipHandler.new credentials.rosetta_url,
                                             log: credentials.debug,
                                             log_level: credentials.debug_level
  end

  let(:expected_info) {
    { module: 'PER', stage: 'Finished', status: 'FINISHED' }
  }

  let(:expected_ies) { [{pid: 'IE433994'}] }

  it 'should get SIP info' do

    sip_info = sip_handler.get_info(55010)
    expect(sip_info).not_to be_nil
    expect(sip_info.to_hash).to match expected_info
  end

  it 'should get list of IEs in the SIP' do

    ies = sip_handler.get_ies(55010)
    expect(ies).not_to be_nil
    expect(ies.map(&:to_h)).to match_array expected_ies
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
libis-services-0.1.11 spec/rosetta_sip_spec.rb
libis-services-0.1.10 spec/rosetta_sip_spec.rb
libis-services-0.1.9 spec/rosetta_sip_spec.rb