Skip to content

Commit

Permalink
CRIMAP-728 Revert back to always outputting firs_court_hearing_name (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mseedat-moj authored Nov 6, 2023
1 parent 1798bb2 commit 395df10
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
6 changes: 0 additions & 6 deletions app/presenters/case_details_presenter.rb
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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)
Expand Down
18 changes: 8 additions & 10 deletions app/views/casework/crime_applications/_case_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@
<% end%>

<!-- Court hearing -->
<% unless case_details.first_court_hearing? %>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= label_text(:first_court_hearing) %>
</dt>
<dd class="govuk-summary-list__value">
<%= case_details.first_court_hearing %>
</dd>
</div>
<% end %>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= label_text(:first_court_hearing) %>
</dt>
<dd class="govuk-summary-list__value">
<%= case_details.first_court_hearing %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= label_text(:next_court_hearing) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 395df10

Please sign in to comment.