Skip to content

Commit

Permalink
Add spec for bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirby committed Oct 11, 2024
1 parent b170de1 commit bf2106d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/phi_attrs/phi_record/instance__allow_phi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@
it 'get_phi with block returns value' do |t|
expect(patient_jane.get_phi(file_name, t.full_description) { patient_jane.first_name }).to eq('Jane')
end

it 'does not leak phi allowance if get_phi returns' do |t|
def name_getter
patient_jane.get_phi(file_name, t.full_description) { return patient_jane.first_name }
end

expect(patient_jane.phi_allowed?).to be false
first_name = name_getter
expect(first_name).to eq('Jane')
expect(patient_jane.phi_allowed?).to be false
end
end

context 'collection' do
Expand Down

0 comments on commit bf2106d

Please sign in to comment.