factories for synapse, topic, user

This commit is contained in:
Devin Howard 2015-10-19 15:23:49 +08:00
parent e3a4207827
commit 310222aef9
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,9 @@
FactoryGirl.define do
factory :synapse do
desc { random_string(10) }
category :to
permission :commons
association :node1, factory: :topic
association :node2, factory: :topic
end
end

6
spec/factories/topics.rb Normal file
View file

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :topic do
name { random_string(10) }
permission :commons
end
end

9
spec/factories/users.rb Normal file
View file

@ -0,0 +1,9 @@
FactoryGirl.define do
factory :user do
name { random_string(10) }
email { random_string(10) + '@' + random_string(10) + '.com' }
code { random_string(8) }
joinedwithcode { random_string(8) }
password 'omgwtfbbq'
end
end