Sha256: d98ec9258e52cda02c8c52f65224840e1fea1e696e61bb86769f7079fa7528db

Contents?: true

Size: 761 Bytes

Versions: 8

Compression:

Stored size: 761 Bytes

Contents

require 'rails_helper'

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

  it "should change circulation_status" do
    withdraw = FactoryGirl.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

8 entries across 6 versions & 2 rubygems

Version Path
enju_library-0.2.3 spec/models/withdraw_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/spec/models/withdraw_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/spec/models/withdraw_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/spec/models/withdraw_spec.rb
enju_library-0.2.2 spec/models/withdraw_spec.rb
enju_library-0.2.1 spec/models/withdraw_spec.rb
enju_library-0.2.0 spec/models/withdraw_spec.rb
enju_library-0.2.0.beta.10 spec/models/withdraw_spec.rb