In testing the dynamic content of an HTML email I discovered that some of the names generated by Faker::Name.last_name contained apostrophes, such as "O'Kon".
When this string was rendered in the email template it was rendered with the apostrophe escaped to an HTML entity and this caused the regex-based matcher to fail.
It would be great to be able to generate "HTML-safe" strings from Faker that don't contain any characters that will be HTML-escaped by template renderers.
+1
+1
+1
(runs over to CircleCI to hit rebuild)
+1 (also just hit rebuild in Travis for this)
+1 still nothing on this?
@JoeWoodward PRs are always welcome. ;)
Alternatively, one can use locales to override the default selection of names to avoid ones that cause problems in particular scenarios.
OK, I've overriden the locale for now. I'll push a PR when I get a chance
On 20 Jul 2016, at 9:50 pm, Benjamin Curtis [email protected] wrote:
@JoeWoodward PRs are always accepted. ;)
Alternatively, one can use locales to override the default selection of names to avoid ones that cause problems in particular scenarios.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
+1 on this
For the case of the names there's already a PR open https://github.com/stympy/faker/pull/716
I have thought about this a bit more, and I don't think solving this in Faker is the way to go. Instead, I would suggest three potential ways to deal with this:
I recommend option 3. Apostrophes happen in real life, so you might as well make your test resilient enough to handle real-world scenarios. Of course, you're welcome to ignore my recommendation -- I'm just some random guy on the internet. :)
Most helpful comment
@JoeWoodward PRs are always welcome. ;)
Alternatively, one can use locales to override the default selection of names to avoid ones that cause problems in particular scenarios.