Created
February 26, 2018 12:03
-
-
Save Lackoftactics/0e24918b2758c0b71bd84cfd4b77fd2f to your computer and use it in GitHub Desktop.
Smarter tests without workaround
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
| factory :registration_active_registrant, class: Registration::Registrant do | |
| before(:create) do |registrant| | |
| registrant.class.skip_callback(:create, :before, :init) | |
| create(:active_registration_registrant_status) unless Registration::RegistrantStatus.exists?(name: 'Active') | |
| end | |
| completed_at Date.current | |
| activated_at Date.current | |
| status_id { Registration::RegistrantStatus::ACTIVE_ID } | |
| after(:create) do |registrant| | |
| registrant.class.set_callback(:create, :before, :init) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment