Sha256: 106569089be9bbf79bc8d53c66f98f6738437dbfa86f2079c250aa9d2d0a6634
Contents?: true
Size: 1.3 KB
Versions: 37
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true FactoryBot.define do factory :transplant_registration, class: "Renalware::Transplants::Registration" do patient { build(:transplant_patient) } trait :with_statuses do after(:create) do |registration| 10.downto(8).each do |day| start_date = day.days.ago create( :transplant_registration_status, registration: registration, started_on: start_date, terminated_on: start_date + 1.day ) end create( :transplant_registration_status, registration: registration, started_on: 7.days.ago ) end end trait :in_status do transient do status { "active" } end after(:create) do |registration, evaluator| create( :transplant_registration_status, registration: registration, started_on: 7.days.ago, description: create(:transplant_registration_status_description, name: evaluator.status.humanize, code: evaluator.status) ) create( :transplant_registration_status, registration: registration, started_on: 10.days.ago, terminated_on: 7.days.ago ) end end end end
Version data entries
37 entries across 37 versions & 1 rubygems