require "helper" require "minitest/autorun" class TestItem < HoldingsTestCase def test_has_item_count record = load_fixture("holdings_289196.xml").records.first assert_equal "391937", record.holding_id assert_equal '78', record.item_count end def test_location_exceptions record = load_fixture("holdings_289196.xml").records.first assert_kind_of Array, record.temp_locations assert_equal "98 (June-Dec. 1993) Shelved in Barnard. Temporarily unavailable. Try BorrowDirect or ILL", record.temp_locations.first end def test_no_item_statuses record = load_fixture("holdings_289196.xml").records[1] assert_equal 'none', record.item_status[:status] end def test_item_statuses_not_checked_out record = load_fixture("holdings_289196.xml").records[0] assert_equal 'available', record.item_status[:status] assert_equal 'Not checked out', record.item_status[:messages].first end def test_item_status_checkout_patron record = load_fixture("holdings_4191079.xml").records[0] assert_equal 'not_available', record.item_status[:status] assert_equal 'Checked out, due 2011-09-30 23:00:00 - Recall, or try Borrow Direct or ILL.', record.item_status[:messages].first record = load_fixture("holdings_4191079.xml").records[2] assert_equal 'some_available', record.item_status[:status] assert_equal 'v.2 Checked out, due 2011-09-30 23:00:00 - Recall, or try Borrow Direct or ILL.', record.item_status[:messages].first end def test_item_status_checkout_status_patron record = load_fixture("holdings_4191079.xml").records[1] assert_equal 'not_available', record.item_status[:status] assert_equal 'At Bindery. Try Borrow Direct or ILL.', record.item_status[:messages].first record = load_fixture("holdings_4191079.xml").records[3] assert_equal 'some_available', record.item_status[:status] assert_equal 'v.2 At Bindery. Try Borrow Direct or ILL.', record.item_status[:messages].first end end