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.153 spec/factories/patients/practices.rb
renalware-core-2.0.152 spec/factories/patients/practices.rb
renalware-core-2.0.151 spec/factories/patients/practices.rb
renalware-core-2.0.149 spec/factories/patients/practices.rb
renalware-core-2.0.148 spec/factories/patients/practices.rb
renalware-core-2.0.147 spec/factories/patients/practices.rb
renalware-core-2.0.146 spec/factories/patients/practices.rb
renalware-core-2.0.145 spec/factories/patients/practices.rb
renalware-core-2.0.144 spec/factories/patients/practices.rb
renalware-core-2.0.143 spec/factories/patients/practices.rb
renalware-core-2.0.142 spec/factories/patients/practices.rb
renalware-core-2.0.141 spec/factories/patients/practices.rb
renalware-core-2.0.140 spec/factories/patients/practices.rb
renalware-core-2.0.139 spec/factories/patients/practices.rb
renalware-core-2.0.138 spec/factories/patients/practices.rb
renalware-core-2.0.137 spec/factories/patients/practices.rb
renalware-core-2.0.136 spec/factories/patients/practices.rb
renalware-core-2.0.135 spec/factories/patients/practices.rb
renalware-core-2.0.134 spec/factories/patients/practices.rb
renalware-core-2.0.133 spec/factories/patients/practices.rb