Sha256: 1a0f25b375202ff2fd5b204dc39996118ddbe3cf4b03c5844ccd03d1484996fa
Contents?: true
Size: 1.35 KB
Versions: 118
Compression:
Stored size: 1.35 KB
Contents
# frozen_string_literal: true FactoryBot.define do sequence(:requestor_order_number) { |n| "PlacerID-#{n}" } factory :pathology_observation_request, class: "Renalware::Pathology::ObservationRequest" do association :description, factory: :pathology_request_description requestor_order_number requestor_name { "Jane Doe" } requested_at { 1.year.ago } trait :full_blood_count_with_observations do association :description, factory: :pathology_request_description, code: "FBC" after(:create) do |request| %w(WBC HGB PLT).each do |obx_code| desc = create(:pathology_observation_description, code: obx_code) create( :pathology_observation, description: desc, request: request, observed_at: request.requested_at ) end end end trait :renal_live_urea_with_observations do association :description, factory: :pathology_request_description, code: "RLU" after(:create) do |request| %w(NA POT URE).each do |obx_code| desc = create(:pathology_observation_description, code: obx_code) create( :pathology_observation, description: desc, request: request, observed_at: request.requested_at, result: 1.0 ) end end end end end
Version data entries
118 entries across 118 versions & 1 rubygems