spec/factories/item.rb in enju_circulation-0.4.0.beta.4 vs spec/factories/item.rb in enju_circulation-0.4.0.rc.1

- old
+ new

@@ -1,12 +1,12 @@ FactoryBot.define do factory :item do sequence(:item_identifier){|n| "item_#{n}"} circulation_status_id{CirculationStatus.find(1).id} if defined?(EnjuCircuation) manifestation_id{FactoryBot.create(:manifestation).id} - association :bookstore - association :budget_type - after(:create) do |item| + after(:build) do |item| + bookstore = Bookstore.find(1) + budget_type = BudgetType.find(1) item.use_restriction = UseRestriction.find_by(name: 'Limited Circulation, Normal Loan Period') end end end