add some rspec tests for supplier and article

This commit is contained in:
wvengen 2013-07-14 02:49:40 +02:00
parent 7fa8193010
commit 3c264f6225
8 changed files with 110 additions and 2 deletions

View 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