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

FFaker::HTMLIpsum.fancy_string can return a string with no HTML #500

Open
xunker opened this issue Aug 7, 2021 · 2 comments
Open

FFaker::HTMLIpsum.fancy_string can return a string with no HTML #500

xunker opened this issue Aug 7, 2021 · 2 comments

Comments

@xunker
Copy link
Contributor

xunker commented Aug 7, 2021

I have a case where, given the right random seed, FFaker::HTMLIpsum.fancy_string will return a string with no HTML.

Reproduction with v2.18.0 (ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]) (MacOS 10.15.7):

> FFaker::Random.seed = 13 # Thirteen?!? Spooky unlucky coincidence!
> FFaker::Random.reset!
> str = FFaker::HTMLIpsum.fancy_string
# => "Placeat voluptatem alias iusto doloribus voluptatibus adipisci excepturi soluta. Nulla minima ex recusandae quisquam eius. Odit similique maxime sed quis vero aliquam quidem. Sunt ad ut officia nesciunt vitae earum sit deleniti. Esse tenetur perferendis fugit quasi. Reiciendis excepturi inventore ducimus harum numquam. Incidunt aperiam sint occaecati sunt aut. Neque accusantium deleniti provident voluptatibus doloribus. Eligendi doloribus pariatur itaque aspernatur similique. Aliquam enim cupiditate perspiciatis eius officia tempora cumque blanditiis. Error vel non harum sed." 
str.include?('<')
# => false 

All other methods won't have this issue regardless of the random seed used because they explicitly put in at least one HTML tag set via a content_tag_for call.

@gabrielcosta42
Copy link
Contributor

It's more common than it looks. The same output can be seen using a lot of other seeds (97, 176, 197).

@gabrielcosta42
Copy link
Contributor

Should be fixed after #516 PR.

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

No branches or pull requests

2 participants