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 am-i-getting-minimum-wage to use ERB templates for questions #2114

Conversation

floehopper
Copy link
Contributor

No description provided.

@chrisroos chrisroos self-assigned this Nov 18, 2015
@chrisroos
Copy link
Contributor

Looks good to me.

@chrisroos chrisroos added the LGTM label Nov 18, 2015
I ran the following command:

    $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/am-i-getting-minimum-wage
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/am-i-getting-minimum-wage -name '*.html' | xargs sed -i .bak "s/'/'/g"
    $ git clean -fd test/artefacts/am-i-getting-minimum-wage/**/*.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 used the following command to hide these changes:

    $ git diff --ignore-blank-lines

The change to ERB templates has also removed the trailing newline for question
attributes which were using a `|`-prefixed multi-line YAML string. Even though
the newline has been reproduced faithfully in the corresponding ERB template, it
has been lost by one/both of the calls to `ErbRenderer#normalize_blank_lines`
and/or `String#chomp`.

I feel as if the resulting HTML is actually cleaner and so I'm happy to update
the regression test artefacts accordingly.
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-am-i-getting-minimum-wage-to-use-erb-templates-for-questions branch from 979e6cb to dfd7fab Compare November 18, 2015 19:34
floehopper added a commit that referenced this pull request Nov 18, 2015
…age-to-use-erb-templates-for-questions

Convert am-i-getting-minimum-wage to use ERB templates for questions
@floehopper floehopper merged commit d48ffa3 into master Nov 18, 2015
@floehopper floehopper deleted the convert-am-i-getting-minimum-wage-to-use-erb-templates-for-questions branch November 18, 2015 19:37
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