Sha256: 07de060c0fc50996e2c43d4db02241bff69014900bff72f746b8ba5977da97cf

Contents?: true

Size: 556 Bytes

Versions: 95

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  sequence :practice_code do |n|
    "M" + n.to_s.rjust(5, "0")
  end

  factory :practice, class: "Renalware::Patients::Practice" do
    name { "Trumpton Medical Centre" }
    email { "admin@trumptonmedicalcentre-nhs.net" }
    code { generate(:practice_code) }

    # ensures addressable_type and addressable_id work is assigned, using
    # FactoryBot's simple assoc method does not work
    #
    before(:create) do |practice|
      practice.build_address(attributes_for(:address))
    end
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
renalware-core-2.0.89 spec/factories/patients/practices.rb
renalware-core-2.0.88 spec/factories/patients/practices.rb
renalware-core-2.0.87 spec/factories/patients/practices.rb
renalware-core-2.0.86 spec/factories/patients/practices.rb
renalware-core-2.0.85 spec/factories/patients/practices.rb
renalware-core-2.0.84 spec/factories/patients/practices.rb
renalware-core-2.0.83 spec/factories/patients/practices.rb
renalware-core-2.0.82 spec/factories/patients/practices.rb
renalware-core-2.0.81 spec/factories/patients/practices.rb
renalware-core-2.0.80 spec/factories/patients/practices.rb
renalware-core-2.0.79 spec/factories/patients/practices.rb
renalware-core-2.0.78 spec/factories/patients/practices.rb
renalware-core-2.0.77 spec/factories/patients/practices.rb
renalware-core-2.0.76 spec/factories/patients/practices.rb
renalware-core-2.0.75 spec/factories/patients/practices.rb
renalware-core-2.0.74 spec/factories/patients/practices.rb
renalware-core-2.0.73 spec/factories/patients/practices.rb
renalware-core-2.0.72 spec/factories/patients/practices.rb
renalware-core-2.0.71 spec/factories/patients/practices.rb
renalware-core-2.0.70 spec/factories/patients/practices.rb