Sha256: d2cb5b78e40999d192c432067ba1ee866fefcf57c9c7c4f6410647f653d94d46

Contents?: true

Size: 1.8 KB

Versions: 3

Compression:

Stored size: 1.8 KB

Contents

require 'spec_helper'
module Exlibris
  module Aleph
    class Patron
      class Record
        class Item
          describe CreateHold, vcr: {cassette_name: 'patron'} do
            let(:patron_id) { 'BOR_ID' }
            let(:record_id) { 'NYU01002296594' }
            let(:item_id) { 'NYU50002296594000010' }
            let(:pickup_location) do
              Exlibris::Aleph::PickupLocation.new('BOBST', 'NYU Bobst')
            end
            let(:parameters) { {pickup_location: pickup_location} }
            subject(:create_hold) { CreateHold.new(patron_id, record_id, item_id, parameters) }
            describe '#patron_id' do
              subject { create_hold.patron_id }
              it { should eq patron_id }
            end
            describe '#record_id' do
              subject { create_hold.record_id }
              it { should eq record_id }
            end
            describe '#item_id' do
              subject { create_hold.item_id }
              it { should eq item_id }
            end
            describe '#note' do
              subject { create_hold.note }
              it { should eq 'Action Succeeded' }
              context 'when the patron does not have permissions place a hold on the item' do
                let(:patron_id) { 'BOR_ID_WITHOUT_HOLD_PERMISSION' }
                it { should eq 'Item or like copy is on shelf. Cannot place hold request.' }
              end
            end
            describe '#error?' do
              subject { create_hold.error? }
              it { should be_false }
              context 'when the patron does not have permissions place a hold on the item' do
                let(:patron_id) { 'BOR_ID_WITHOUT_HOLD_PERMISSION' }
                it { should be_true }
              end
            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/patron/record/item/create_hold_spec.rb
exlibris-aleph-2.0.3 spec/exlibris/aleph/patron/record/item/create_hold_spec.rb
exlibris-aleph-2.0.0 spec/exlibris/aleph/patron/record/item/create_hold_spec.rb