Skip to content

Commit

Permalink
Merge pull request #255 from ministryofjustice/feature/rst-211-remove…
Browse files Browse the repository at this point in the history
…-probate-changes

revert probate changes
  • Loading branch information
leoapost authored Apr 24, 2017
2 parents 4799a15 + 5ba9dcf commit 9f00dc7
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 312 deletions.
17 changes: 1 addition & 16 deletions app/services/navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def next
private

def next_question_id
if skip_to_claim_step?
:claim
elsif skip_income_steps?
if skip_income? || skip_income_range? || skip_income_amount?
probate_or_claim
elsif skip_savings_and_investment_extra?
:benefit
Expand All @@ -33,10 +31,6 @@ def skip_income?
@current_question == :benefit && @online_application.benefits?
end

def skip_probate?
@current_question == :income_amount
end

def skip_income_range?
(@current_question == :income_kind && @online_application.income&.zero?)
end
Expand All @@ -47,15 +41,6 @@ def skip_income_amount?
@online_application.income_max_threshold_exceeded)
end

def skip_income_steps?
skip_income? || skip_income_range? || skip_income_amount?
end

def skip_to_claim_step?
ProbateFeesSwitch.disable_probate_fees? &&
(skip_income_steps? || skip_probate?)
end

def skip_savings_and_investment_extra?
@current_question == :savings_and_investment &&
!@online_application.savings_and_investment_extra_required?
Expand Down
8 changes: 0 additions & 8 deletions app/views/questions/headers/_form_name.html.slim
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
- if ProbateFeesSwitch.disable_probate_fees?
p#probate-warning.notice.text.util_mt-large
i.icon.icon-important
span.visually-hidden
Warning
strong.bold-small
= t('probate_warning_html', scope: @form.i18n_scope)

p =t('example', scope: @form.i18n_scope)
53 changes: 26 additions & 27 deletions app/views/summaries/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,32 @@ table.summary
span.visuallyhidden
|  
=t('income', scope: 'summary.labels').downcase
-unless ProbateFeesSwitch.disable_probate_fees?
- if @summary.probate
tr
th scope="row" = t('deceased_name', scope: 'summary.labels')
td =@summary.deceased_name
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('deceased_name', scope: 'summary.labels').downcase
tr
th scope="row" = t('date_of_death', scope: 'summary.labels')
td =@summary.date_of_death
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('date_of_death', scope: 'summary.labels').downcase
-elsif [email protected]?
tr
th scope="row" =t('probate', scope: 'summary.labels')
td =t("probate_case_#{@summary.probate}", scope: 'summary')
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('probate', scope: 'summary.labels').downcase
-if @summary.probate
tr
th scope="row" = t('deceased_name', scope: 'summary.labels')
td =@summary.deceased_name
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('deceased_name', scope: 'summary.labels').downcase
tr
th scope="row" = t('date_of_death', scope: 'summary.labels')
td =@summary.date_of_death
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('date_of_death', scope: 'summary.labels').downcase
-elsif [email protected]?
tr
th scope="row" =t('probate', scope: 'summary.labels')
td =t("probate_case_#{@summary.probate}", scope: 'summary')
td.right= link_to question_path(:probate) do
=t('summary.change')
span.visuallyhidden
|  
=t('probate', scope: 'summary.labels').downcase
tr
th scope="row" =t('claim', scope: 'summary.labels')
td =t("claim_number_#{@summary.case_number?}", scope: 'summary')
Expand Down
1 change: 0 additions & 1 deletion config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ cy:
summary: Help gydag enw neu rif y ffurflen
et: Rwyf angen help gyda ffi tribiwnlys cyflogaeth
example: Rhowch rif y ffurflen llys neu dribiwnlys ar gyfer y busnes llys y mae arnoch angen help gydag ef, er enghraifft ffurflen ‘C100’, ‘D8’ neu 'Hysbysiad o Apêl'
probate_warning_html: Nid yw'r Gwasanaeth Help i Dalu Ffioedd ar gael i geisiadau am brofiant ddim mwy. <a class="external" rel="external" href="https://www.gov.uk/wills-probate-inheritance/applying-for-a-grant-of-representation">Dod o hyd i fanylion pellach a gwneud cais am brofiant.</a>
text: Pa ffi llys neu dribiwnlys y mae arnoch angen help gyda hi?
title: Enw neu rif y ffurflen
unknown: Dydw i ddim yn gwybod beth yw enw neu rif y ffurflen
Expand Down
1 change: 0 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ en:
summary: Help with form name or number
et: I need help with an employment tribunal fee
example: Enter the court or tribunal form number for the court business you need help with, for example ‘C100’, ‘D8’ or ‘notice to appeal’ form.
probate_warning_html: Help with Fees is no longer available for probate applications. <a class="external" rel="external" href="https://www.gov.uk/wills-probate-inheritance/applying-for-a-grant-of-representation">Find further details and apply for probate.</a>
text: What court or tribunal fee do you need help with?
title: Form name or number
unknown: I don’t know the form name or number
Expand Down
2 changes: 0 additions & 2 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ income:
max_threshold_base: 5085
per_child_increment: 245
married_supplement: 160
probate_fees:
release_date: <%= ENV['PROBATE_FEES_RELEASE_DATE'] || "2017-03-22 15:00:00 0" %>
5 changes: 0 additions & 5 deletions lib/probate_fees_switch.rb

This file was deleted.

6 changes: 1 addition & 5 deletions spec/features/apply_for_help_with_fees_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ def find_finish_button

RSpec.feature 'As a user' do

before { Timecop.freeze(a_day_before_disable_probate_fees) }
after do
Timecop.return
I18n.locale = :en
end
after { I18n.locale = :en }

I18n.available_locales.each do |locale|
context "using the #{locale.upcase} language" do
Expand Down
21 changes: 0 additions & 21 deletions spec/features/pages/form_name_question_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,5 @@
expect(page).to have_content 'Enter the form name or number, or select \'I don’t know the form name or number\''
end
end

context 'when probate fees are still supported' do
before do
Timecop.freeze(a_day_before_disable_probate_fees)
given_user_answers_questions_up_to(:form_name)
end

after { Timecop.return }

scenario 'I do not expect the warning message to be displayed' do
expect(page).not_to have_css('#probate-warning')
end
end

context 'when probate fees are no longer supported' do
scenario 'I expect a warning message to be displayed' do
Timecop.freeze(probate_fees_release_date) do
expect(page).to have_css('#probate-warning')
end
end
end
end
end
10 changes: 1 addition & 9 deletions spec/features/pages/income_question_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
context 'completing the form correctly' do
context 'when "no income" selected' do
before do
Timecop.freeze(a_day_before_disable_probate_fees)
check :income_kind_applicant_13
click_button 'Continue'
end

after { Timecop.return }

scenario 'I expect to be routed to the "probate" page' do
expect(page).to have_content 'Are you paying a fee for a probate case?'
end
Expand Down Expand Up @@ -76,12 +73,7 @@
end

context 'when accessing the "income_amount" page for "Help with fees"' do
before do
Timecop.freeze(a_day_before_disable_probate_fees)
given_user_answers_questions_up_to(:income_amount)
end

after { Timecop.return }
before { given_user_answers_questions_up_to(:income_amount) }

context 'completing the form correctly' do
before do
Expand Down
3 changes: 0 additions & 3 deletions spec/features/pages/probate_question_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
require 'rails_helper'

RSpec.feature 'As a user' do
before { Timecop.freeze(a_day_before_disable_probate_fees) }
after { Timecop.return }

context 'when accessing the "probate" page for "Help with fees"' do
before { given_user_answers_questions_up_to(:probate) }

Expand Down
118 changes: 42 additions & 76 deletions spec/features/pages/summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,35 @@
end
end

context 'when probate fess is still active' do
before { Timecop.freeze(a_day_before_disable_probate_fees) }
after { Timecop.return }

context 'after answering yes to the probate question' do
before do
given_user_answers_questions_up_to(:probate)
choose 'probate_kase_true'
fill_in :probate_deceased_name, with: 'Foo'
fill_in :probate_date_of_death, with: Time.zone.today - 1.month
click_button 'Continue'
page.visit '/summary'
end
context 'after answering yes to the probate question' do
before do
given_user_answers_questions_up_to(:probate)
choose 'probate_kase_true'
fill_in :probate_deceased_name, with: 'Foo'
fill_in :probate_date_of_death, with: Time.zone.today - 1.month
click_button 'Continue'
page.visit '/summary'
end

scenario 'I expect to see my answers' do
expect(page).to have_no_content 'Probate case'
expect(page).to have_content 'Name of deceasedFooChange'
expect(page).to have_content "Date of death#{(Time.zone.today - 1.month).strftime(Date::DATE_FORMATS[:default])}Change"
end
scenario 'I expect to see my answers' do
expect(page).to have_no_content 'Probate case'
expect(page).to have_content 'Name of deceasedFooChange'
expect(page).to have_content "Date of death#{(Time.zone.today - 1.month).strftime(Date::DATE_FORMATS[:default])}Change"
end
end

context 'after answering no to the probate question' do
before do
given_user_answers_questions_up_to(:probate)
choose 'probate_kase_false'
click_button 'Continue'
page.visit '/summary'
end
context 'after answering no to the probate question' do
before do
given_user_answers_questions_up_to(:probate)
choose 'probate_kase_false'
click_button 'Continue'
page.visit '/summary'
end

scenario 'I do not expect to see the probate sub headers' do
expect(page).to have_content 'Probate case'
expect(page).to have_no_content 'Name of deceased'
expect(page).to have_no_content 'Date of death'
end
scenario 'I do not expect to see the probate sub headers' do
expect(page).to have_content 'Probate case'
expect(page).to have_no_content 'Name of deceased'
expect(page).to have_no_content 'Date of death'
end
end

Expand Down Expand Up @@ -95,52 +90,23 @@
end
end

context 'when probate is still active' do
scenario 'the change links take me to the correct page' do
Timecop.freeze(a_day_before_disable_probate_fees) do
given_user_provides_all_data
visit '/summary'
end

expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:form_name)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:marital_status)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:savings_and_investment)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:benefit)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dependent)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:income_kind)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:fee)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:probate)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:claim)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dob)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:national_insurance)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:personal_detail)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:applicant_address)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:contact)}')]"
end
end

context 'when probate is deactivated' do
scenario 'the change links take me to the correct page' do
Timecop.freeze(probate_fees_release_date) do
given_user_provides_all_data
visit '/summary'
end

expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:form_name)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:marital_status)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:savings_and_investment)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:benefit)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dependent)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:income_kind)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:fee)}')]"
expect(page).not_to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:probate)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:claim)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dob)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:national_insurance)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:personal_detail)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:applicant_address)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:contact)}')]"
end
scenario 'the change links take me to the correct page' do
given_user_provides_all_data
visit '/summary'
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:form_name)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:marital_status)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:savings_and_investment)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:benefit)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dependent)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:income_kind)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:fee)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:probate)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:claim)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:dob)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:national_insurance)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:personal_detail)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:applicant_address)}')]"
expect(page).to have_xpath "//a[starts-with(text(), 'Change')][starts-with(@href,'#{question_path(:contact)}')]"
end
end
end
3 changes: 0 additions & 3 deletions spec/features/pages/user_can_apply_for_et_case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
RSpec.feature 'As a user' do
context 'I want to be able to apply for help with fees for my ET case' do
before do
Timecop.freeze { a_day_before_disable_probate_fees }
given_the_submission_service_is_available
when_they_apply_for_help_with_et_case
expect(page).to have_content 'Your application for help with fees is not finished yet'
end

after { Timecop.return }

scenario 'I expect to see instructions how to finish application' do
expect(page).to have_content 'You must email or post this help with fees reference number HWF-ABC123 along with your employment tribunal claim number to the relevant Employment Tribunal Central Office.'
expect(page).to have_content 'Email or send your letter to the relevant Employment Tribunal Central Office detailed below.'
Expand Down
23 changes: 0 additions & 23 deletions spec/lib/probate_fees_switch_spec.rb

This file was deleted.

Loading

0 comments on commit 9f00dc7

Please sign in to comment.