Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert benefits-cap-calculator to use ERB templates for questions #2113

Conversation

floehopper
Copy link
Contributor

No description provided.

@chrisroos
Copy link
Contributor

Apart from my comment about the indenting of content in content_for :body this all looks good to me.

@chrisroos chrisroos added the LGTM label Nov 18, 2015
@chrisroos chrisroos self-assigned this Nov 18, 2015
@floehopper floehopper force-pushed the convert-benefits-cap-calculator-to-use-erb-templates-for-questions branch from 4241a9b to 1446115 Compare November 18, 2015 14:55
@floehopper
Copy link
Contributor Author

Since #2116 has been merged, I've rebased this against master, re-run the new version of the script, updated the checksums, and force-pushed. You can see the body with fixed indentation in this commit.

I ran the following command:

    $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/benefits-cap-calculator

    Writing template: receive_housing_benefit.govspeak.erb
    Writing template: working_tax_credit.govspeak.erb
    Writing template: receiving_exemption_benefits.govspeak.erb
    Writing template: receiving_non_exemption_benefits.govspeak.erb
    Writing template: bereavement_amount.govspeak.erb
    Writing template: carers_amount.govspeak.erb
    Writing template: child_benefit_amount.govspeak.erb
    Writing template: child_tax_amount.govspeak.erb
    Writing template: esa_amount.govspeak.erb
    Writing template: guardian_amount.govspeak.erb
    Writing template: incapacity_amount.govspeak.erb
    Writing template: income_support_amount.govspeak.erb
    Writing template: jsa_amount.govspeak.erb
    Writing template: maternity_amount.govspeak.erb
    Writing template: sda_amount.govspeak.erb
    Writing template: widowed_mother_amount.govspeak.erb
    Writing template: widowed_parent_amount.govspeak.erb
    Writing template: widow_pension_amount.govspeak.erb
    Writing template: widows_aged_amount.govspeak.erb
    Writing template: housing_benefit_amount.govspeak.erb
    Writing template: single_couple_lone_parent.govspeak.erb

    Deleting i18n YAML: benefit-cap-calculator.yml

    Now insert `use_erb_templates_for_questions` at top of flow: benefit-cap-calculator.rb
Since #2098 & #2112, apostrophes rendered via `SmartAnswer::ErbRenderer` have
not been HTML-escaped. Now that we are rendering question content via this
renderer, we need to update the regression test artefacts for question pages
accordingly.

I ran the following commands to do this:

    $ find test/artefacts/benefit-cap-calculator -name '*.html' | xargs sed -i .bak "s/'/'/g"
    $ git clean -fd test/artefacts/benefit-cap-calculator/**/*.bak
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
Re-generating the checksums has removed the i18n YAML file and added the new
question templates as I expected.
@floehopper floehopper force-pushed the convert-benefits-cap-calculator-to-use-erb-templates-for-questions branch from 1446115 to ac3c73d Compare November 18, 2015 19:29
floehopper added a commit that referenced this pull request Nov 18, 2015
…r-to-use-erb-templates-for-questions

Convert benefits-cap-calculator to use ERB templates for questions
@floehopper floehopper merged commit a8e3cbb into master Nov 18, 2015
@floehopper floehopper deleted the convert-benefits-cap-calculator-to-use-erb-templates-for-questions branch November 18, 2015 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants