I keep having problems w/ expect_render, mainly that it doesn’t work as
advertised. I can put a template.expect_render(:partial => ‘this should
fail’) in a view spec and I get no failure. I have read the docs, I have
followed the threads (two, which never resolve the initial issue and
dissolve into some other discussion) without much explanation for what
I’m experiencing. This has manifested itself in both 1.1.3 and 1.1.2
releases. I do use mocha mocking. So as a last resort I turned that off
and expect_render still ‘fails silently’. (I’ve also seen the failure in
Rails 2.0.2 and 1.2.5 if that helps.
I’m at a loss at how to continue debugging the issue. Any suggestions?
I keep having problems w/ expect_render, mainly that it doesn’t work as
advertised. I can put a template.expect_render(:partial => ‘this should
fail’) in a view spec and I get no failure. I have read the docs, I have
followed the threads (two, which never resolve the initial issue and
dissolve into some other discussion) without much explanation for what
I’m experiencing. This has manifested itself in both 1.1.3 and 1.1.2
releases. I do use mocha mocking. So as a last resort I turned that off
and expect_render still ‘fails silently’. (I’ve also seen the failure in
Rails 2.0.2 and 1.2.5 if that helps.
I stand corrected. It is only not working for me when mocha is enabled.
I just stepped through four cases and detailed the view spec, view (that
is sometimes empty) and results.
This is running on OSX 10.4.11 with the following setup:
moonbook:~ barnekr$ gem list --local | grep “mocha|rspec|rails”
mocha (0.5.5, 0.5.3, 0.4.0, 0.3.2)
rails (2.0.2, 1.2.5, 1.2.3, 1.2.2, 1.2.1, 1.1.6)
rspec (1.1.3, 1.1.2, 1.0.8, 1.0.5)
moonbook:~ barnekr$ ruby -v
ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1]