Created
February 26, 2018 12:47
-
-
Save Lackoftactics/e4a7268589edbe7b1526e17f712329f3 to your computer and use it in GitHub Desktop.
factory bot traits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :registration_participant, class: Registration::Participant do | |
f_name { Faker::Name.first_name } | |
l_name { Faker::Name.last_name } | |
waiver_agree true | |
token SecureRandom.hex(10) | |
association :registrant, factory: :registration_registrant | |
trait :skip_validate do | |
registrant nil | |
to_create { |instance| instance.save(validate: false) } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment