Sha256: b8ffbf90bd5fe2a82aec718d37fb0e0f291c27dd63575f2795875e1b480abbb5

Contents?: true

Size: 532 Bytes

Versions: 40

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  sequence :practice_code do |n|
    "PR432#{n}"
  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

40 entries across 40 versions & 1 rubygems

Version Path
renalware-core-2.0.42 spec/factories/patients/practices.rb
renalware-core-2.0.41 spec/factories/patients/practices.rb
renalware-core-2.0.40 spec/factories/patients/practices.rb
renalware-core-2.0.39 spec/factories/patients/practices.rb
renalware-core-2.0.38 spec/factories/patients/practices.rb
renalware-core-2.0.37 spec/factories/patients/practices.rb
renalware-core-2.0.36 spec/factories/patients/practices.rb
renalware-core-2.0.35 spec/factories/patients/practices.rb
renalware-core-2.0.34 spec/factories/patients/practices.rb
renalware-core-2.0.33 spec/factories/patients/practices.rb
renalware-core-2.0.32 spec/factories/patients/practices.rb
renalware-core-2.0.31 spec/factories/patients/practices.rb
renalware-core-2.0.30 spec/factories/patients/practices.rb
renalware-core-2.0.28 spec/factories/patients/practices.rb
renalware-core-2.0.27 spec/factories/patients/practices.rb
renalware-core-2.0.26 spec/factories/patients/practices.rb
renalware-core-2.0.25 spec/factories/patients/practices.rb
renalware-core-2.0.24 spec/factories/patients/practices.rb
renalware-core-2.0.23 spec/factories/patients/practices.rb
renalware-core-2.0.22 spec/factories/patients/practices.rb