ambition/spec/factories/projects.rb

16 lines
381 B
Ruby
Raw Permalink Normal View History

require 'faker'
2016-12-11 17:40:47 +08:00
FactoryGirl.define do
factory :project do
name { Faker::Name.title }
sequence(:content){ |n| "This is project content#{n}"}
after(:build) do |project|
3.times { project.users << FactoryGirl.create(:user_with_sequence_number) }
end
factory :project_name_length_gt_20 do
2016-12-15 09:56:40 +08:00
name { Faker::Internet.password(51, 51) }
2016-12-11 17:40:47 +08:00
end
end
end