Skip to content

Commit 8bee67e

Browse files
committed
Remove and deprecate section_slug within flows
Left methods with deprecation warning to avoid blowing up with any unmerged answers.
1 parent d397d13 commit 8bee67e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+10
-80
lines changed

lib/flows/additional-commodity-code.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
32
satisfies_need "2013"
43

54
# Q1

lib/flows/am-i-getting-minimum-wage.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
3-
subsection_slug "tax"
42
satisfies_need "2013"
53

64
# Q1

lib/flows/appeal-a-benefits-decision.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
satisfies_need "845"
22
status :draft
3-
section_slug "money-and-tax"
43

54
decision_appeal_limit_in_months = 13
65

lib/flows/auto-enrolled-into-workplace-pension.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
3-
subsection_slug "pension"
42
satisfies_need "2483"
53

64
multiple_choice :work_in_uk? do
@@ -58,4 +56,4 @@
5856
outcome :enrolled_overseas
5957
outcome :enrolled_contract
6058
outcome :not_enrolled_office
61-
outcome :enrolled
59+
outcome :enrolled

lib/flows/become-a-driving-instructor.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
satisfies_need "B188"
22
status :published
3-
section_slug "driving"
4-
subsection_slug "driving-instructors"
53

64
multiple_choice :are_you_21_or_over? do
75
option :yes => :have_you_had_licence_for_3_years?

lib/flows/become-a-motorcycle-instructor.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
satisfies_need "999999"
22
status :draft
3-
section_slug "driving"
43

54
multiple_choice :qualified_motorcycle_instructor? do
65
option :no => :over_21?
@@ -30,4 +29,4 @@
3029
outcome :too_young
3130
outcome :need_licence
3231
outcome :application_instructions
33-
outcome :need_longer_licence
32+
outcome :need_longer_licence

lib/flows/benefits-if-you-are-abroad.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
satisfies_need "392"
22
status :draft
3-
section_slug "money-and-tax"
43

54
# Q1
65
multiple_choice :have_you_told_jobcentre_plus do

lib/flows/calculate-agricultural-holiday-entitlement.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "work"
32

43
calculator = AgriculturalHolidayEntitlementCalculator.new()
54

lib/flows/calculate-child-maintenance-draft.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
32

43
## Q1
54
value_question :how_many_children_paid_for? do
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :published
2-
section_slug "business"
3-
subsection_slug "employing-people"
42
satisfies_need "1761"
53

64
use_shared_logic "redundancy_pay"

lib/flows/calculate-married-couples-allowance.rb

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
status :published
2-
3-
section_slug "money-and-tax"
4-
subsection_slug "tax"
52
satisfies_need 2012
63

74
multiple_choice :were_you_or_your_partner_born_on_or_before_6_april_1935? do

lib/flows/calculate-night-work-hours.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "work"
32

43
multiple_choice :how_old? do
54
option '18-or-over' => :exception_to_limits?
@@ -144,4 +143,4 @@
144143
outcome :not_a_night_worker
145144
outcome :limit_exceeded
146145
outcome :within_legal_limit
147-
outcome :outside_legal_limit
146+
outcome :outside_legal_limit

lib/flows/calculate-state-pension.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
3-
subsection_slug "pension"
42
satisfies_need "564"
53

64
multiple_choice :which_calculation? do

lib/flows/calculate-statutory-sick-pay.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
32
satisfies_need "2013"
43

54
## Q1

lib/flows/calculate-your-holiday-entitlement.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
status :published
22
satisfies_need 355
3-
section_slug "work"
43

54
multiple_choice :what_is_your_employment_status? do
65
option "full-time" => :full_time_how_long_employed?
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :published
2-
section_slug "work"
3-
subsection_slug "ending-work"
42
satisfies_need "1761"
53

64
use_shared_logic "redundancy_pay"

lib/flows/can-i-get-a-british-passport.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :draft
2-
section_slug "travel"
3-
subsection_slug "passports"
42

53
multiple_choice :do_you_have? do
64
option :british_citizenship => :is_one_of_these_true?

lib/flows/child-benefit-tax-calculator.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
32

43
# Question 1
54
multiple_choice :which_tax_year? do

lib/flows/childcare-costs-for-tax-credits.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
satisfies_need "9999"
22
status :draft
3-
section_slug "money-and-tax"
4-
subsection_slug "tax"
53

64
# Questions
75
#

lib/flows/claim-a-national-insurance-refund.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need "B148"
2-
status :published
3-
section_slug "money-and-tax"
42

53
multiple_choice :which_class? do
64
save_input_as :ni_class
@@ -48,4 +46,4 @@
4846
outcome :outcome_3
4947
outcome :outcome_4
5048
outcome :outcome_5
51-
outcome :outcome_6
49+
outcome :outcome_6

lib/flows/driving-in-the-uk-on-a-foreign-licence.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
satisfies_need 9999
2-
section_slug "driving"
32
status :draft
43

54
multiple_choice :are_you? do
@@ -84,4 +83,4 @@
8483
outcome :a11
8584
outcome :a12
8685
outcome :a13
87-
outcome :a14
86+
outcome :a14

lib/flows/estimate-self-assessment-penalties.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
status :draft
22
satisfies_need "B692"
3-
section_slug "money-and-tax"
43

54
calculator_dates = {
65
:online_filing_deadline => {

lib/flows/exchange-a-foreign-driving-licence.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
satisfies_need 9999
2-
section_slug "driving"
32
status :draft
43

54
multiple_choice :are_you_resident_in_gb? do

lib/flows/inherits-someone-dies-without-will.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need 2006
2-
section_slug "family"
3-
subsection_slug "death-and-bereavement"
42
status :published
53

64

lib/flows/legal-right-to-work-in-the-uk.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need "B91"
2-
section_slug "business"
3-
subsection_slug "employing-people"
42
status :published
53

64
multiple_choice :have_uk_passport? do

lib/flows/maternity-benefits.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need 1660
2-
section_slug "family"
3-
subsection_slug "maternity-and-paternity"
42
status :published
53

64
date_question :when_is_your_baby_due? do

lib/flows/maternity-paternity-calculator.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
status :draft
2-
section_slug "money-and-tax"
3-
subsection_slug "tax"
42
satisfies_need "2013"
53

64
## Q1

lib/flows/recognise-a-trade-union.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
satisfies_need "B193"
2-
section_slug "work"
32
status :draft
43

54
# Q1

lib/flows/register-a-death.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
satisfies_need "2189"
22
status :draft
3-
section_slug "family"
43

54

65
multiple_choice :where_did_the_death_happen? do

lib/flows/report-a-lost-or-stolen-passport.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "travel"
32

43
multiple_choice :has_your_passport_been_lost_or_stolen? do
54
option :lost

lib/flows/request-for-flexible-working.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
status :draft
2-
section_slug "work"
32
satisfies_need "9999"
43

54
## Q1
@@ -73,4 +72,4 @@
7372
## A1
7473
outcome :no_right_to_apply
7574
## A2
76-
outcome :right_to_apply
75+
outcome :right_to_apply

lib/flows/student-finance-calculator.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need 2175
2-
section_slug "education"
3-
subsection_slug "student-money"
42
status :published
53

64
multiple_choice :are_you_a_full_time_or_part_time_student? do

lib/flows/towing-rules.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
satisfies_need 9999
2-
section_slug "family"
3-
subsection_slug "driving"
42
status :draft
53

64
## Cars and light vehicles

lib/flows/vehicles-you-can-drive.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
satisfies_need 1625
2-
section_slug ""
32
status :draft
43

54
## Q1

lib/smart_answer/flow.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def status(s=nil)
3838
end
3939

4040
def section_slug(s=nil)
41-
@section_slug = s if s
42-
@section_slug
41+
ActiveSupport::Deprecation.warn("Sections are no longer handled within smartanswers.", caller(1))
42+
nil
4343
end
4444

4545
def subsection_slug(s=nil)
46-
@subsection_slug = s if s
47-
@subsection_slug
46+
ActiveSupport::Deprecation.warn("Sections are no longer handled within smartanswers.", caller(1))
47+
nil
4848
end
4949

5050
def multiple_choice(name, options = {}, &block)

test/fixtures/flow_registraion_presenter_sample/flow-sample.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
section_slug "sample"
21
satisfies_need 4242
32

43
multiple_choice :hotter_or_colder? do

test/fixtures/flow_registraion_presenter_sample/flow_sample.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ en-GB:
55
description: FLOW_DESCRIPTION
66
title:
77
FLOW_TITLE
8-
section:
9-
SECTION
108
body: |
119
FLOW_BODY
1210
hotter_or_colder?:

test/fixtures/flow_registraion_presenter_sample/flow_sample_interpolation.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ en-GB:
55
description: FLOW_DESCRIPTION
66
title:
77
FLOW_TITLE
8-
section:
9-
SECTION
108
body: |
119
FLOW_BODY
1210
hotter_or_colder?:

test/fixtures/flow_sample.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
section_slug "sample"
21

32
multiple_choice :hotter_or_colder? do
43
option :hotter => :hot

test/fixtures/smart_answers_controller_test/section_name.yml

-4
This file was deleted.

test/functional/smart_answers_controller_test.rb

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def setup
1414
name :sample
1515

1616
satisfies_need 1337
17-
section_slug "family"
1817

1918
multiple_choice :do_you_like_chocolate? do
2019
option :yes => :you_have_a_sweet_tooth

test/unit/flow_test.rb

-8
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ class FlowTest < ActiveSupport::TestCase
125125
assert s.draft?
126126
end
127127

128-
test "should have a section slug" do
129-
s = SmartAnswer::Flow.new do
130-
section_slug "family"
131-
end
132-
133-
assert_equal "family", s.section_slug
134-
end
135-
136128
test "should have a status" do
137129
s = SmartAnswer::Flow.new do
138130
status :published

0 commit comments

Comments
 (0)