Skip to content

Commit 47054f3

Browse files
committed
135311: Implement code suggestions
1 parent 07d26e5 commit 47054f3

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

app/policies/power_of_attorney_policy.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def access?
1414

1515
def log_access_denied
1616
Rails.logger.info('POA ACCESS DENIED',
17-
loa: user.loa&.dig(:current),
17+
loa_current: user.loa&.dig(:current),
1818
loa3: user.loa3?,
19-
icn: user.icn.present?,
20-
participant_id: user.participant_id.present?)
19+
icn_present: user.icn.present?,
20+
participant_id_present: user.participant_id.present?)
2121
end
2222
end

spec/policies/power_of_attorney_policy_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
let(:user) { build(:user, :loa3) }
1111

1212
it 'grants access and does not log' do
13-
expect(Rails.logger).not_to receive(:info)
13+
expect(Rails.logger).not_to receive(:info).with('POA ACCESS DENIED', anything)
1414
expect(subject).to permit(user, :power_of_attorney)
1515
end
1616
end
@@ -22,10 +22,10 @@
2222
expect(Rails.logger).to receive(:info).with(
2323
'POA ACCESS DENIED',
2424
hash_including(
25-
loa: 3,
25+
loa_current: 3,
2626
loa3: true,
27-
icn: false,
28-
participant_id: true
27+
icn_present: false,
28+
participant_id_present: true
2929
)
3030
)
3131
expect(subject).not_to permit(user, :power_of_attorney)
@@ -39,10 +39,10 @@
3939
expect(Rails.logger).to receive(:info).with(
4040
'POA ACCESS DENIED',
4141
hash_including(
42-
loa: 3,
42+
loa_current: 3,
4343
loa3: true,
44-
icn: true,
45-
participant_id: false
44+
icn_present: true,
45+
participant_id_present: false
4646
)
4747
)
4848
expect(subject).not_to permit(user, :power_of_attorney)
@@ -56,10 +56,10 @@
5656
expect(Rails.logger).to receive(:info).with(
5757
'POA ACCESS DENIED',
5858
hash_including(
59-
loa: 1,
59+
loa_current: 1,
6060
loa3: false,
61-
icn: true,
62-
participant_id: false
61+
icn_present: true,
62+
participant_id_present: false
6363
)
6464
)
6565
expect(subject).not_to permit(user, :power_of_attorney)

0 commit comments

Comments
 (0)