[rspec-users] How to use request helpers outside of controller specs?

2010-11-17 Thread turkan
I asked this questions on some other places before, but have found no solution yet. I'd like to include the request helper (from ActionDispatch::Integration::RequestHelpers, like post and xhr methods) also in some specs outside of my controller specs. The problem is that these request helpers are o

[rspec-users] should_receive(:render).with(some_option) not working

2010-11-16 Thread turkan
Hello. As some former posts already mentioned there is some difficulty to test the render method when also checking for arguments: http://jdfrens.blogspot.com/2010/08/upgrading-to-rails-3-and-rspec-2-part_20.html http://rails-bestpractices.com/questions/17-test-the-render-method-in-a-controller-wi

[rspec-users] response.should have_text leads to undefined method `has_text?'

2010-10-05 Thread turkan
One of my controllers directly renders some JSON output that I would like to test with RSpec. For that I use 'response.should have_text("foobar")' in my spec file, but that leads to a Failure/Error: response.should have_text("enim") undefined method `has_text?' for # I read here somewhere that we