Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assert_select fails with single quote(apostrophe) content

My code in view is

<h3 id="account_owner">This is Jhon's account</h3>

The line to test this code is

assert_select "h3#account_owner", "This is Jhon's account"

Test fails and says

"This is Jhon's account" was expected but was This is Jhon&# x27;s account'

I put a space between "&# x27;" because it also converts into ' on output of this question. Any guess? Or how should I test this line?

like image 852
Malik Shahzad Avatar asked Dec 13 '13 06:12

Malik Shahzad


1 Answers

I didn't found a valid answer, but to test that line i do something like assert_select "h3#account_owner", "This is Jhon's account".gsub("\'", '&# x27;')

Again, I put a space between "&# x27;" because it also converts into ' on output of this answer. I am still looking for better way to test this.

like image 62
Malik Shahzad Avatar answered Nov 03 '22 11:11

Malik Shahzad