Sha256: cf64689c4d47e1470e2cc127e6409b91a852de2c6912224411d4871d8aa9f824

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
module Exlibris
  module Aleph
    module API
      module Client
        class Record
          describe Items, vcr: {cassette_name: 'record', record: :new_episodes} do
            let(:record_id) { 'NYU01000980206' }
            let(:view) { 'full' }
            let(:query) { { view: view } }
            subject(:items) { Items.new(record_id, query) }
            it { should be_a Items }
            describe '#id' do
              subject { items.record_id }
              it { should eq record_id }
            end
            describe '#reply_code' do
              subject { items.reply_code }
              it { should eq '0000' }
            end
            describe '#reply_text' do
              subject { items.reply_text }
              it { should eq 'ok' }
            end
            describe '#error?' do
              subject { items.error? }
              it { should be_false }
            end
            describe '#to_h' do
              subject { items.to_h }
              it { should be_a Hash }
            end
            describe '#to_xml' do
              subject { items.to_xml }
              it { should be_a String }
            end
            context 'when initialized without a "query" argument' do
              subject { Items.new(record_id) }
              it { should be_a Items }
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 spec/exlibris/aleph/api/client/record/items_spec.rb
exlibris-aleph-2.0.3 spec/exlibris/aleph/api/client/record/items_spec.rb
exlibris-aleph-2.0.0 spec/exlibris/aleph/api/client/record/items_spec.rb