Skip to content

Commit

Permalink
Correct method test
Browse files Browse the repository at this point in the history
  • Loading branch information
MeenaModhvadia committed Jan 9, 2025
1 parent 6044073 commit cfe268c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/policies/case/sar/offender_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def can_record_data_request?
check_can_trigger_event(:add_data_received)
end

def can_send_day_1_email
clear_failed_checks
check_can_trigger_event(:send_day_1_email)
end

def can_send_acknowledgement_letter?
clear_failed_checks
check_user_can_manage_offender_sar
Expand Down
2 changes: 1 addition & 1 deletion app/views/cases/data_request_areas/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ div class="case"
td
span = @commissioning_document&.download_link

- if @data_request_area.data_request_emails.blank? && policy(@case).can_record_data_request? && [email protected]_sar_complaint?
- if @data_request_area.data_request_emails.blank? && policy(@case).can_send_day_1_email?
div.button-holder
= link_to t('button.send_email'), send_email_case_data_request_area_path(@case, @data_request_area), class: 'button button-high data_request_area_send_email'

Expand Down

0 comments on commit cfe268c

Please sign in to comment.