Sha256: 32793557f3aa9a5e68fa7d1f8b5891f3476e8d49e2f542834dc8878f4117c4ac

Contents?: true

Size: 1.35 KB

Versions: 40

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :event, class: "Renalware::Events::Event" do
    accountable
    patient
    event_type factory: :access_clinic_event_type
    date_time { Time.zone.now }
    description "Needs blood sample taken."
    notes "Would like son to accompany them on clinic visit."

    factory :simple_event, class: "Renalware::Events::Simple" do
    end

    factory :swab, class: "Renalware::Events::Swab" do
      event_type factory: :swab_event_type
      document {
        {
          type: Renalware::Events::Swab::Document.type.values.first,
          result: Renalware::Events::Swab::Document.result.values.first,
          location: "The location"
        }
      }
    end

    factory :investigation, class: "Renalware::Events::Investigation" do
      event_type factory: :investigation_event_type
      document {
        {
          modality: "other",
          type: Renalware::Events::Investigation::Document.type.values.first,
          result: "result"
        }
      }

      trait :transplant_recipient do
        before :create do |investigation|
          investigation.document.modality = "transplant_recipient"
        end
      end

      trait :transplant_donor do
        before :create do |investigation|
          investigation.document.modality = "transplant_donor"
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
renalware-core-2.0.21 spec/factories/events/events.rb
renalware-core-2.0.20 spec/factories/events/events.rb
renalware-core-2.0.18 spec/factories/events/events.rb
renalware-core-2.0.17 spec/factories/events/events.rb
renalware-core-2.0.16 spec/factories/events/events.rb
renalware-core-2.0.15 spec/factories/events/events.rb
renalware-core-2.0.14 spec/factories/events/events.rb
renalware-core-2.0.13 spec/factories/events/events.rb
renalware-core-2.0.12 spec/factories/events/events.rb
renalware-core-2.0.11 spec/factories/events/events.rb
renalware-core-2.0.9 spec/factories/events/events.rb
renalware-core-2.0.8 spec/factories/events/events.rb
renalware-core-2.0.7 spec/factories/events/events.rb
renalware-core-2.0.5 spec/factories/events/events.rb
renalware-core-2.0.4 spec/factories/events/events.rb
renalware-core-2.0.3 spec/factories/events/events.rb
renalware-core-2.0.2 spec/factories/events/events.rb
renalware-core-2.0.1 spec/factories/events/events.rb
renalware-core-2.0.0 spec/factories/events/events.rb
renalware-core-2.0.0.pre.rc13 spec/factories/events/events.rb