Sha256: 53475d9eb700bae697f5aa2598d8d495ec8d41295c1dd71e27e094bbf203f759

Contents?: true

Size: 470 Bytes

Versions: 6

Compression:

Stored size: 470 Bytes

Contents

FactoryBot.define do
  factory :reserve do
    before(:create) do |reserve|
      profile = FactoryBot.create(:profile)
      user = User.new(FactoryBot.attributes_for(:user))
      user.profile = profile
      reserve.user = user
    end
    after(:build) do |reserve|
      item = FactoryBot.create(:item, use_restriction: UseRestriction.find_by(name: 'Available On Shelf'))
      reserve.manifestation = item.manifestation
      reserve.item = item
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_circulation-0.3.11 spec/factories/reserve.rb
enju_circulation-0.3.10 spec/factories/reserve.rb
enju_circulation-0.3.9 spec/factories/reserve.rb
enju_circulation-0.4.0.rc.1 spec/factories/reserve.rb
enju_circulation-0.3.8 spec/factories/reserve.rb
enju_circulation-0.3.7 spec/factories/reserve.rb