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