Sha256: e9d348916923a4d9d66bdbefd1ec9f24a7cf0373173b97c0de55f8a3ebb3a62c

Contents?: true

Size: 678 Bytes

Versions: 85

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

module PatientsSpecHelper
  def set_modality(patient:,
                   modality_description:,
                   started_on: Time.zone.today,
                   by: Renalware::User.first)

    # ChangePatientModality returns a Success or Failure object
    new_modality = Renalware::Modalities::ChangePatientModality
      .new(patient: patient, user: by)
      .call(
        description: modality_description,
        started_on: started_on
      )

    patient.reload # need to do this in order for current_modality to be set

    # Return ther object associated with the returned Success or Failure object
    new_modality.object
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
renalware-core-2.1.1 spec/support/patients_spec_helper.rb
renalware-core-2.1.0 spec/support/patients_spec_helper.rb
renalware-core-2.0.167 spec/support/patients_spec_helper.rb
renalware-core-2.0.166 spec/support/patients_spec_helper.rb
renalware-core-2.0.165 spec/support/patients_spec_helper.rb
renalware-core-2.0.164 spec/support/patients_spec_helper.rb
renalware-core-2.0.163 spec/support/patients_spec_helper.rb
renalware-core-2.0.162 spec/support/patients_spec_helper.rb
renalware-core-2.0.161 spec/support/patients_spec_helper.rb
renalware-core-2.0.160 spec/support/patients_spec_helper.rb
renalware-core-2.0.159 spec/support/patients_spec_helper.rb
renalware-core-2.0.158 spec/support/patients_spec_helper.rb
renalware-core-2.0.157 spec/support/patients_spec_helper.rb
renalware-core-2.0.156 spec/support/patients_spec_helper.rb
renalware-core-2.0.155 spec/support/patients_spec_helper.rb
renalware-core-2.0.153 spec/support/patients_spec_helper.rb
renalware-core-2.0.152 spec/support/patients_spec_helper.rb
renalware-core-2.0.151 spec/support/patients_spec_helper.rb
renalware-core-2.0.149 spec/support/patients_spec_helper.rb
renalware-core-2.0.148 spec/support/patients_spec_helper.rb