diff --git a/spec/models/supplier_spec.rb b/spec/models/supplier_spec.rb index 6bcc6e7b..70ba6def 100644 --- a/spec/models/supplier_spec.rb +++ b/spec/models/supplier_spec.rb @@ -19,13 +19,9 @@ describe Supplier do end it 'return correct tolerance' do - supplier = create :supplier - articles = create_list(:article, 1, unit_quantity: 1, supplier_id: supplier.id) - supplier.reload + supplier = create :supplier, articles: create_list(:article, 1, unit_quantity: 1) expect(supplier.has_tolerance?).to be false - supplier2 = create :supplier - articles = create_list(:article, 1, unit_quantity: 2, supplier_id: supplier2.id) - supplier.reload + supplier2 = create :supplier, articles: create_list(:article, 1, unit_quantity: 2) expect(supplier2.has_tolerance?).to be true end