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.110 spec/factories/patients/practices.rb
renalware-core-2.0.109 spec/factories/patients/practices.rb
renalware-core-2.0.108 spec/factories/patients/practices.rb
renalware-core-2.0.106 spec/factories/patients/practices.rb
renalware-core-2.0.105 spec/factories/patients/practices.rb
renalware-core-2.0.104 spec/factories/patients/practices.rb
renalware-core-2.0.103 spec/factories/patients/practices.rb
renalware-core-2.0.102 spec/factories/patients/practices.rb
renalware-core-2.0.101 spec/factories/patients/practices.rb
renalware-core-2.0.100 spec/factories/patients/practices.rb
renalware-core-2.0.99 spec/factories/patients/practices.rb
renalware-core-2.0.98 spec/factories/patients/practices.rb
renalware-core-2.0.97 spec/factories/patients/practices.rb
renalware-core-2.0.96 spec/factories/patients/practices.rb
renalware-core-2.0.95 spec/factories/patients/practices.rb
renalware-core-2.0.94 spec/factories/patients/practices.rb
renalware-core-2.0.93 spec/factories/patients/practices.rb
renalware-core-2.0.92 spec/factories/patients/practices.rb
renalware-core-2.0.91 spec/factories/patients/practices.rb
renalware-core-2.0.90 spec/factories/patients/practices.rb