From 1915663259a1f4fe6000033590a9dbd255bb346c Mon Sep 17 00:00:00 2001 From: James Mead Date: Wed, 18 Nov 2015 23:46:43 +0000 Subject: [PATCH 1/4] Use ERB templates for Qs in legalisation-document-checker I ran the following command: $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/legalisation-document-checker Writing template: which_documents_do_you_want_legalised.govspeak.erb Deleting i18n YAML: legalisation-document-checker.yml Now insert `use_erb_templates_for_questions` at top of flow: legalisation-document-checker.rb --- ...cuments_do_you_want_legalised.govspeak.erb | 67 ++++++++++++++++++ .../en/legalisation-document-checker.yml | 68 ------------------- 2 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 lib/smart_answer_flows/legalisation-document-checker/questions/which_documents_do_you_want_legalised.govspeak.erb delete mode 100644 lib/smart_answer_flows/locales/en/legalisation-document-checker.yml diff --git a/lib/smart_answer_flows/legalisation-document-checker/questions/which_documents_do_you_want_legalised.govspeak.erb b/lib/smart_answer_flows/legalisation-document-checker/questions/which_documents_do_you_want_legalised.govspeak.erb new file mode 100644 index 00000000000..d490f801cb7 --- /dev/null +++ b/lib/smart_answer_flows/legalisation-document-checker/questions/which_documents_do_you_want_legalised.govspeak.erb @@ -0,0 +1,67 @@ +<% content_for :title do %> + Which documents do you want legalised? +<% end %> + +<% options( + "acro-police-certificate": "ACRO Police Certificate", + "affidavit": "Affidavit", + "articles-of-association": "Articles of association", + "bank-statement": "Bank statement", + "baptism-certificate": "Baptism certificate", + "birth-certificate": "Birth certificate", + "certificate-of-incorporation": "Certificate of incorporation", + "certificate-of-freesale": "Certificate of freesale", + "certificate-of-memorandum": "Certificate of memorandum", + "certificate-of-naturalisation": "Certificate of naturalisation", + "certificate-of-no-impediment": "Certificate of no impediment", + "chamber-of-commerce-document": "Chamber of Commerce document", + "change-of-name-deed": "Change of name deed", + "civil-partnership-certificate": "Civil partnership certificate", + "criminal-records-bureau-document": "Criminal Records Bureau (CRB) document", + "criminal-records-check": "Criminal records check", + "companies-house-document": "Companies House document", + "county-court-document": "County court document", + "court-document": "Court document", + "court-of-bankruptcy-document": "Court of Bankruptcy document", + "death-certificate": "Death certificate", + "decree-nisi": "Decree nisi", + "decree-absolute": "Decree absolute", + "degree-certificate-uk": "Degree certificate (UK)", + "department-of-business-innovation-skills-document": "Department of Business, Innovation and Skills (BIS) document", + "department-of-health-document": "Department of Health document", + "diploma": "Diploma", + "disclosure-scotland-document": "Disclosure Scotland document", + "doctor-letter-medical": "Doctor’s letter (medical)", + "driving-licence": "Driving licence (copy)", + "educational-certificate-uk": "Educational certificate (UK)", + "export-certificate": "Export certificate", + "family-division-high-court-justice-document": "Family Division of the High Court of Justice document", + "fingerprints": "Fingerprints document", + "fit-note-from-a-doctor": "Fit note (from a doctor)", + "government-issued-document": "Government issued document", + "grant-of-probate": "Grant of probate", + "high-court-justice-document": "High Court of Justice document", + "hmrc-document": "HM Revenue and Customs document", + "home-office-document": "Home Office document", + "last-will-testament": "Last will and testament", + "letter-from-employer": "Letter from an employer", + "letter-of-enrolment": "Letter of enrolment", + "letter-of-invitation": "Letter of invitation", + "letter-of-no-trace": "Letter of no trace", + "medical-report": "Medical report", + "marriage-certificate": "Marriage certificate", + "name-change-deed-or-document": "Name change deed or document", + "passport-copy-only": "Passport (copy only)", + "pet-export-document": "Pet export document from the Department of Environment, Food and Rural Affairs (DEFRA)", + "police-disclosure-document": "Police disclosure document", + "power-of-attorney": "Power of attorney", + "probate": "Probate", + "reference-from-an-employer": "Reference from an employer", + "religious-document": "Religious document", + "sheriff-court-document": "Sheriff court document", + "sick-note-from-doctor": "Sick note (from a doctor)", + "statutory-declaration": "Statutory declaration", + "test-results-medical": "Test results (medical)", + "translation": "Translation", + "utility-bill": "Utility bill" +) %> diff --git a/lib/smart_answer_flows/locales/en/legalisation-document-checker.yml b/lib/smart_answer_flows/locales/en/legalisation-document-checker.yml deleted file mode 100644 index 5722469f7fd..00000000000 --- a/lib/smart_answer_flows/locales/en/legalisation-document-checker.yml +++ /dev/null @@ -1,68 +0,0 @@ -en-GB: - flow: - legalisation-document-checker: - #Q1 - which_documents_do_you_want_legalised?: - title: Which documents do you want legalised? - options: - "acro-police-certificate": "ACRO Police Certificate" - "affidavit": "Affidavit" - "articles-of-association": "Articles of association" - "bank-statement": "Bank statement" - "baptism-certificate": "Baptism certificate" - "birth-certificate": "Birth certificate" - "certificate-of-incorporation": "Certificate of incorporation" - "certificate-of-freesale": "Certificate of freesale" - "certificate-of-memorandum": "Certificate of memorandum" - "certificate-of-naturalisation": "Certificate of naturalisation" - "certificate-of-no-impediment": "Certificate of no impediment" - "chamber-of-commerce-document": "Chamber of Commerce document" - "change-of-name-deed": "Change of name deed" - "civil-partnership-certificate": "Civil partnership certificate" - "criminal-records-bureau-document": "Criminal Records Bureau (CRB) document" - "criminal-records-check": "Criminal records check" - "companies-house-document": "Companies House document" - "county-court-document": "County court document" - "court-document": "Court document" - "court-of-bankruptcy-document": "Court of Bankruptcy document" - "death-certificate": "Death certificate" - "decree-nisi": "Decree nisi" - "decree-absolute": "Decree absolute" - "degree-certificate-uk": "Degree certificate (UK)" - "department-of-business-innovation-skills-document": "Department of Business, Innovation and Skills (BIS) document" - "department-of-health-document": "Department of Health document" - "diploma": "Diploma" - "disclosure-scotland-document": "Disclosure Scotland document" - "doctor-letter-medical": "Doctor’s letter (medical)" - "driving-licence": "Driving licence (copy)" - "educational-certificate-uk": "Educational certificate (UK)" - "export-certificate": "Export certificate" - "family-division-high-court-justice-document": "Family Division of the High Court of Justice document" - "fingerprints": "Fingerprints document" - "fit-note-from-a-doctor": "Fit note (from a doctor)" - "government-issued-document": "Government issued document" - "grant-of-probate": "Grant of probate" - "high-court-justice-document": "High Court of Justice document" - "hmrc-document": "HM Revenue and Customs document" - "home-office-document": "Home Office document" - "last-will-testament": "Last will and testament" - "letter-from-employer": "Letter from an employer" - "letter-of-enrolment": "Letter of enrolment" - "letter-of-invitation": "Letter of invitation" - "letter-of-no-trace": "Letter of no trace" - "medical-report": "Medical report" - "marriage-certificate": "Marriage certificate" - "name-change-deed-or-document": "Name change deed or document" - "passport-copy-only": "Passport (copy only)" - "pet-export-document": "Pet export document from the Department of Environment, Food and Rural Affairs (DEFRA)" - "police-disclosure-document": "Police disclosure document" - "power-of-attorney": "Power of attorney" - "probate": "Probate" - "reference-from-an-employer": "Reference from an employer" - "religious-document": "Religious document" - "sheriff-court-document": "Sheriff court document" - "sick-note-from-doctor": "Sick note (from a doctor)" - "statutory-declaration": "Statutory declaration" - "test-results-medical": "Test results (medical)" - "translation": "Translation" - "utility-bill": "Utility bill" From 64debcf240af45ee67ae834728045bd1f00c4828 Mon Sep 17 00:00:00 2001 From: James Mead Date: Wed, 18 Nov 2015 23:47:53 +0000 Subject: [PATCH 2/4] Now insert `use_erb_templates_for_questions` at top of flow --- lib/smart_answer_flows/legalisation-document-checker.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/smart_answer_flows/legalisation-document-checker.rb b/lib/smart_answer_flows/legalisation-document-checker.rb index 7ac46b89f94..4d1fb0c99df 100644 --- a/lib/smart_answer_flows/legalisation-document-checker.rb +++ b/lib/smart_answer_flows/legalisation-document-checker.rb @@ -6,6 +6,8 @@ def define status :published satisfies_need "101010" + use_erb_templates_for_questions + i18n_prefix = "flow.legalisation-document-checker" #Q1 From 2da05645a4107da7f32a58174f9b3e4246f7e771 Mon Sep 17 00:00:00 2001 From: James Mead Date: Wed, 18 Nov 2015 23:48:31 +0000 Subject: [PATCH 3/4] Update regression test artefacts The change to ERB templates has introduced a few extra newlines in the question page HTML, but none of them affect the content viewable by the user. I verified that the changes were all only blank lines using the following command: $ git diff --ignore-blank-lines --- test/artefacts/legalisation-document-checker/y.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/artefacts/legalisation-document-checker/y.html b/test/artefacts/legalisation-document-checker/y.html index 6e035cc988b..ebc08a3a374 100644 --- a/test/artefacts/legalisation-document-checker/y.html +++ b/test/artefacts/legalisation-document-checker/y.html @@ -38,6 +38,7 @@

+
    @@ -411,6 +412,7 @@

    +

From ec9b235fb1077680bc96e9866b7ee5c099443e18 Mon Sep 17 00:00:00 2001 From: James Mead Date: Wed, 18 Nov 2015 23:48:59 +0000 Subject: [PATCH 4/4] Update regression test checksums Re-generating the checksums has removed the i18n YAML file and added the new question templates as I expected. --- test/data/legalisation-document-checker-files.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/data/legalisation-document-checker-files.yml b/test/data/legalisation-document-checker-files.yml index dd09e7a8b84..5964a7edf80 100644 --- a/test/data/legalisation-document-checker-files.yml +++ b/test/data/legalisation-document-checker-files.yml @@ -1,9 +1,9 @@ --- -lib/smart_answer_flows/legalisation-document-checker.rb: b160054be666a2317125e6646bd7cb4c -lib/smart_answer_flows/locales/en/legalisation-document-checker.yml: a9ca977abcf14999469adc7f47d1f051 +lib/smart_answer_flows/legalisation-document-checker.rb: eec50547825c770f58f1494090ca4fed test/data/legalisation-document-checker-questions-and-responses.yml: 37c99c68ba04e459447622b01938ce0b test/data/legalisation-document-checker-responses-and-expected-results.yml: d55ccccc64cc1f58b648e810e5fa07e5 lib/smart_answer_flows/legalisation-document-checker/legalisation_document_checker.govspeak.erb: 4be67b8e3aeebe4f3b99a5153b92ccdf lib/smart_answer_flows/legalisation-document-checker/outcomes/outcome_results.govspeak.erb: 00c464b05564abf1824e3da37bca1d24 +lib/smart_answer_flows/legalisation-document-checker/questions/which_documents_do_you_want_legalised.govspeak.erb: 807d6bee48fd47731d066aab6ad50544 lib/smart_answer/calculators/legalisation_documents_data_query.rb: 31d5eec29a4cf4e27a4204e8f08132f9 lib/data/legalisation_documents_data.yml: 788f0f6cbd9b35be712f9aca7c871591