From 395df10eb4e17ca151b50cd31c2661bedf171db8 Mon Sep 17 00:00:00 2001 From: Mo Seedat <47113046+mseedat-moj@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:43:20 +0000 Subject: [PATCH] CRIMAP-728 Revert back to always outputting firs_court_hearing_name (#449) --- app/presenters/case_details_presenter.rb | 6 ------ .../crime_applications/_case_details.html.erb | 18 ++++++++---------- .../that_is_open_and_unassigned_spec.rb | 10 ++++------ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/app/presenters/case_details_presenter.rb b/app/presenters/case_details_presenter.rb index c395820b2..f2778ae6a 100644 --- a/app/presenters/case_details_presenter.rb +++ b/app/presenters/case_details_presenter.rb @@ -1,8 +1,6 @@ require 'laa_crime_schemas' class CaseDetailsPresenter < BasePresenter - # first_court_hearing reflects any changes in the court location, not - # the actual first court hearing location. def first_court_hearing if legacy_application? t('values.not_asked') @@ -29,10 +27,6 @@ def no_hearing_yet? is_first_court_hearing == type_of('no_hearing_yet') end - def first_court_hearing? - is_first_court_hearing == type_of('yes') - end - private def type_of(value) diff --git a/app/views/casework/crime_applications/_case_details.html.erb b/app/views/casework/crime_applications/_case_details.html.erb index e08eca4db..fe68c5a21 100644 --- a/app/views/casework/crime_applications/_case_details.html.erb +++ b/app/views/casework/crime_applications/_case_details.html.erb @@ -41,16 +41,14 @@ <% end%> - <% unless case_details.first_court_hearing? %> -
-
- <%= label_text(:first_court_hearing) %> -
-
- <%= case_details.first_court_hearing %> -
-
- <% end %> +
+
+ <%= label_text(:first_court_hearing) %> +
+
+ <%= case_details.first_court_hearing %> +
+
<%= label_text(:next_court_hearing) %> diff --git a/spec/system/casework/viewing_an_application/that_is_open_and_unassigned_spec.rb b/spec/system/casework/viewing_an_application/that_is_open_and_unassigned_spec.rb index c288541ed..d7f044cd9 100644 --- a/spec/system/casework/viewing_an_application/that_is_open_and_unassigned_spec.rb +++ b/spec/system/casework/viewing_an_application/that_is_open_and_unassigned_spec.rb @@ -397,16 +397,14 @@ let(:hearing_details) do { 'hearing_court_name' => 'Westminster Magistrates Court', + 'first_court_hearing_name' => 'Westminster Magistrates Court', 'is_first_court_hearing' => 'yes', } end - it 'shows the court hearing the case name' do + it 'shows same next and first court hearing the case' do expect(next_court_hearing).to have_content('Westminster Magistrates Court') - end - - it 'does not have a first court hearing the case' do - expect(page).not_to have_content('First court hearing the case') + expect(first_court_hearing).to have_content('Westminster Magistrates Court') end end @@ -419,7 +417,7 @@ } end - it 'shows the next and first court hearing the case' do + it 'shows different next and first court hearing the case' do expect(next_court_hearing).to have_content('Southwark Crown Court') expect(first_court_hearing).to have_content('Westminster Magistrates Court') end