add some rspec tests for supplier and article
This commit is contained in:
parent
7fa8193010
commit
3c264f6225
8 changed files with 110 additions and 2 deletions
19
spec/factories/supplier.rb
Normal file
19
spec/factories/supplier.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
require 'factory_girl'
|
||||
|
||||
FactoryGirl.define do
|
||||
|
||||
factory :supplier do
|
||||
name { Faker::Company.name }
|
||||
phone { Faker::PhoneNumber.phone_number }
|
||||
address { Faker::Address.street_address }
|
||||
|
||||
ignore do
|
||||
article_count 0
|
||||
end
|
||||
|
||||
after :create do |supplier, evaluator|
|
||||
FactoryGirl.create_list :article, evaluator.article_count, supplier: supplier
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue