Assert_select_rjs blocks failing in 1.2.4

I just updated to 1.2.4 and now all my assert_select_rjs blocks are
failing.

For example:

assert_select_rjs :replace_html, “test” do
assert_select “.foo” #fails
end

fails with something like this for the rjs

page.replace_html “test”, ‘

Foo

Is anyone else experiencing the same issue, or does anyone know why my
assert_select_rjs blocks started failing in 1.2.4?

Any help would be greatly appreciated. Thanks!

On 10/8/07, Raymond O’Connor [email protected] wrote:

fails with something like this for the rjs

page.replace_html “test”, ‘

Foo

Is anyone else experiencing the same issue, or does anyone know why my
assert_select_rjs blocks started failing in 1.2.4?

I have upgraded to 1.2.4 and my assert_select_rjs tests are still
working properly. I don’t know if I am using :replace_html in any of
the assertions though. Are those the only ones causing trouble?

Bob S. wrote:

On 10/8/07, Raymond O’Connor [email protected] wrote:

fails with something like this for the rjs

page.replace_html “test”, ‘

Foo

Is anyone else experiencing the same issue, or does anyone know why my
assert_select_rjs blocks started failing in 1.2.4?

I have upgraded to 1.2.4 and my assert_select_rjs tests are still
working properly. I don’t know if I am using :replace_html in any of
the assertions though. Are those the only ones causing trouble?

I just tested it with a :replace and still got failures. It only fails
when you have assert_selects inside assert_select_rjs blocks. The
assert_select statements always fail.

Raymond O’Connor wrote:

I just tested it with a :replace and still got failures. It only fails
when you have assert_selects inside assert_select_rjs blocks. The
assert_select statements always fail.

Try assert_javascript.


Phlip
http://www.oreilly.com/catalog/9780596510657/
^ assert_xpath

On 10/9/07, Raymond O’Connor [email protected] wrote:

I have upgraded to 1.2.4 and my assert_select_rjs tests are still
working properly. I don’t know if I am using :replace_html in any of
the assertions though. Are those the only ones causing trouble?

I just tested it with a :replace and still got failures. It only fails
when you have assert_selects inside assert_select_rjs blocks. The
assert_select statements always fail.

I dunno. I can definitely use assert_select in an assert_select_rjs
block under 1.2.4, so something else is going on.

Bob S. wrote:

On 10/9/07, Raymond O’Connor [email protected] wrote:

I have upgraded to 1.2.4 and my assert_select_rjs tests are still
working properly. I don’t know if I am using :replace_html in any of
the assertions though. Are those the only ones causing trouble?

I just tested it with a :replace and still got failures. It only fails
when you have assert_selects inside assert_select_rjs blocks. The
assert_select statements always fail.

I dunno. I can definitely use assert_select in an assert_select_rjs
block under 1.2.4, so something else is going on.

Thanks for looking into it. I’ll try looking elsewhere for the problem.

I did notice though that when I do a puts @response.body in the test I
get the following:

Element.update(“replace_this”, “\074div class="foo"\076This is
replacement text\074/div\076”);

Is it normal for the < and > to be replaced by \074 and \076 ?

I did notice though that when I do a puts @response.body in the test I
get the following:

Element.update(“replace_this”, “\074div class=“foo”\076This is
replacement text\074/div\076”);

Is it normal for the < and > to be replaced by \074 and \076 ?

I just tested a puts on @response.body in 1.2.3 and the < and > are not
encoded with \074 and \076, so maybe this is another symptom of the
problem?

On 10/10/07, Raymond O’Connor [email protected] wrote:

I just tested a puts on @response.body in 1.2.3 and the < and > are not
encoded with \074 and \076, so maybe this is another symptom of the
problem?

Just wondering if anyone on rails 1.2.4 could do a ‘puts @response.body
on an AJAX response a functional test to see if the < and > show up or
if they are replaced by \074 and \076.

It would be greatly appreciated.

OK, I tried it. I see the angle brackets < and >. I don’t see the \074
and \076 stuff.

Raymond O’Connor wrote:

I did notice though that when I do a puts @response.body in the test I
get the following:

Element.update(“replace_this”, “\074div class=“foo”\076This is
replacement text\074/div\076”);

Is it normal for the < and > to be replaced by \074 and \076 ?

I just tested a puts on @response.body in 1.2.3 and the < and > are not
encoded with \074 and \076, so maybe this is another symptom of the
problem?

Just wondering if anyone on rails 1.2.4 could do a ‘puts @response.body
on an AJAX response a functional test to see if the < and > show up or
if they are replaced by \074 and \076.

It would be greatly appreciated.

Bob S. wrote:

On 10/10/07, Raymond O’Connor [email protected] wrote:

I just tested a puts on @response.body in 1.2.3 and the < and > are not
encoded with \074 and \076, so maybe this is another symptom of the
problem?

Just wondering if anyone on rails 1.2.4 could do a ‘puts @response.body
on an AJAX response a functional test to see if the < and > show up or
if they are replaced by \074 and \076.

It would be greatly appreciated.

OK, I tried it. I see the angle brackets < and >. I don’t see the \074
and \076 stuff.

Thanks a million Bob! This gives me something to work off, hopefully I
can figure it out.

Raymond O’Connor wrote:

Bob S. wrote:

On 10/10/07, Raymond O’Connor [email protected] wrote:

I just tested a puts on @response.body in 1.2.3 and the < and > are not
encoded with \074 and \076, so maybe this is another symptom of the
problem?

Just wondering if anyone on rails 1.2.4 could do a ‘puts @response.body
on an AJAX response a functional test to see if the < and > show up or
if they are replaced by \074 and \076.

It would be greatly appreciated.

OK, I tried it. I see the angle brackets < and >. I don’t see the \074
and \076 stuff.

Thanks a million Bob! This gives me something to work off, hopefully I
can figure it out.

Thank you Bob! I was able to figure it out. One of my filters wasn’t
explicitly returning true (it was returning a nonfalse value).