Sha256: 7411b20127ece7ae7f19ef0ca578a8f144ed85a87b68cfd8cb57b1c91317f809

Contents?: true

Size: 760 Bytes

Versions: 19

Compression:

Stored size: 760 Bytes

Contents

require 'rails_helper'

RSpec.describe Withdraw, type: :model do
  fixtures :all

  it "should change circulation_status" do
    withdraw = FactoryBot.create(:withdraw)
    withdraw.item.circulation_status.name.should eq 'Removed'
    withdraw.item.use_restriction.name.should eq 'Not For Loan'
  end

  it "should not withdraw rented item" do
    withdraw = Withdraw.new(librarian: users(:librarian1))
    withdraw.item = items(:item_00013)
    withdraw.valid?.should be_falsy
  end
end

# == Schema Information
#
# Table name: withdraws
#
#  id           :integer          not null, primary key
#  basket_id    :integer
#  item_id      :integer
#  librarian_id :integer
#  created_at   :datetime         not null
#  updated_at   :datetime         not null
#

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
enju_library-0.3.11 spec/models/withdraw_spec.rb
enju_library-0.3.10 spec/models/withdraw_spec.rb
enju_library-0.3.9 spec/models/withdraw_spec.rb
enju_library-0.3.8 spec/models/withdraw_spec.rb
enju_library-0.3.8.rc.2 spec/models/withdraw_spec.rb
enju_library-0.3.8.rc.1 spec/models/withdraw_spec.rb
enju_library-0.3.7 spec/models/withdraw_spec.rb
enju_library-0.3.6 spec/models/withdraw_spec.rb
enju_library-0.4.0.beta.1 spec/models/withdraw_spec.rb
enju_library-0.3.5 spec/models/withdraw_spec.rb
enju_library-0.3.4 spec/models/withdraw_spec.rb
enju_library-0.3.3 spec/models/withdraw_spec.rb
enju_library-0.3.2 spec/models/withdraw_spec.rb
enju_library-0.3.1 spec/models/withdraw_spec.rb
enju_library-0.3.0 spec/models/withdraw_spec.rb
enju_library-0.3.0.rc.1 spec/models/withdraw_spec.rb
enju_library-0.3.0.beta.2 spec/models/withdraw_spec.rb
enju_library-0.2.5 spec/models/withdraw_spec.rb
enju_library-0.2.4 spec/models/withdraw_spec.rb