Skip to content

Commit

Permalink
[CRIMAPP-1258] Add cifc reason to summary (#681)
Browse files Browse the repository at this point in the history
* CRIMAPP-1258 Add cifc reason

* Update schema

* Remove extra line
  • Loading branch information
mseedat-moj authored Aug 14, 2024
1 parent 3f52722 commit fe86aa8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gem 'laa-criminal-applications-datastore-api-client',

gem 'laa-criminal-legal-aid-schemas',
github: 'ministryofjustice/laa-criminal-legal-aid-schemas',
tag: 'v1.2.1'
tag: 'v1.2.3'

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GIT

GIT
remote: https://github.com/ministryofjustice/laa-criminal-legal-aid-schemas.git
revision: 1ae303e88d01904ab1439dea45c60dd644a20f7b
tag: v1.2.1
revision: 8448023bdd8cb46075a489beea781ce026690d61
tag: v1.2.3
specs:
laa-criminal-legal-aid-schemas (1.2.1)
laa-criminal-legal-aid-schemas (1.2.3)
dry-schema (~> 1.13)
dry-struct (~> 1.6.0)
json-schema (~> 4.0.0)
Expand Down
23 changes: 17 additions & 6 deletions app/views/casework/crime_applications/_overview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@
</div>

<% if overview.cifc? %>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= label_text(:pre_cifc_reason) %>
</dt>
<dd class="govuk-summary-list__value">
<span id="pre_cifc_reason">
<%= overview.pre_cifc_reason.presence || t(:not_provided, scope: 'values') %>
</span>
</dd>
</div>

<% if overview.maat_id_selected? %>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= label_text(:pre_cifc_maat_id) %>
</dt>
<dd class="govuk-summary-list__value">
<span id="pre_cifc_maat_id">
<%= overview.pre_cifc_maat_id.presence || t(:not_provided, scope: 'values') %>
</span>
<span id="pre_cifc_maat_id">
<%= overview.pre_cifc_maat_id.presence || t(:not_provided, scope: 'values') %>
</span>
</dd>
</div>
<% elsif overview.usn_selected? %>
Expand All @@ -27,9 +38,9 @@
<%= label_text(:pre_cifc_usn) %>
</dt>
<dd class="govuk-summary-list__value">
<span id="pre_cifc_usn">
<%= overview.pre_cifc_usn.presence || t(:not_provided, scope: 'values') %>
</span>
<span id="pre_cifc_usn">
<%= overview.pre_cifc_usn.presence || t(:not_provided, scope: 'values') %>
</span>
</dd>
</div>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en/casework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ en:
no_partner_declaration_reason: Reason for no partner declaration
pre_cifc_maat_id: MAAT ID of original application
pre_cifc_usn: USN of original application
pre_cifc_reason: Changes in client's financial circumstances

table_headings: &TABLE_HEADINGS
applicant_name: Applicant's name
Expand Down
4 changes: 2 additions & 2 deletions spec/presenters/outgoing_payments_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

# rubocop:disable Layout/LineLength
it {
expect(formatted_outgoing_payments).to include({ 'childcare' => be_a(LaaCrimeSchemas::Structs::OutgoingsDetails::Outgoing),
expect(formatted_outgoing_payments).to include({ 'childcare' => be_a(LaaCrimeSchemas::Structs::Outgoing),
'maintenance' => nil,
'legal_aid_contribution' => be_a(LaaCrimeSchemas::Structs::OutgoingsDetails::Outgoing) })
'legal_aid_contribution' => be_a(LaaCrimeSchemas::Structs::Outgoing) })
}
# rubocop:enable Layout/LineLength

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@
end

context 'when application_type is `change_in_financial_circumstances`' do
context 'with reason provided' do
let(:application_data) do
super().deep_merge(
'application_type' => 'change_in_financial_circumstances',
'pre_cifc_reason' => 'Won the lottery'
)
end

it 'displays reason' do
expect(page).to have_content("Changes in client's financial circumstances")
expect(page).to have_content('Won the lottery')
end
end

context 'with USN provided' do
let(:application_data) do
super().deep_merge(
Expand Down

0 comments on commit fe86aa8

Please sign in to comment.