metamaps--metamaps/spec/factories/users.rb

16 lines
381 B
Ruby
Raw Normal View History

2015-10-19 07:23:49 +00:00
FactoryGirl.define do
factory :user do
sequence(:name) { |n| "Cool User ##{n}" }
sequence(:email) { |n| "cooluser#{n}@cooldomain.com" }
joinedwithcode { "qwertyui" }
2015-10-19 07:23:49 +00:00
password 'omgwtfbbq'
2015-12-16 14:33:29 +00:00
transient do
validate false
end
2015-12-16 14:33:29 +00:00
# bypass validation of the joinedwithcode
to_create { |instance| instance.save(validate: instance.validate) }
2015-10-19 07:23:49 +00:00
end
end