[rspec-users] Testing layouts with RSpec on Rails

Steve vertebrate at gmail.com
Tue Oct 23 18:45:57 EDT 2007


On Tue, 23 Oct 2007 03:16:32 +0000, Steve wrote:

> On Mon, 22 Oct 2007 20:06:50 -0500, David Chelimsky wrote:
> 
>>> It would feel even less hackish if "render" supported :text like
>>> rails render does. So you could do this:
>>>
>>> render :text => '<div>yielded</div>', :layout => 'application'
>>> response.should have_tag('div', 'yielded')
>> 
>> Good idea. Feature request please.
> 
> Submitted as issue #14969.

I don't know if there are any repercussions, but just adding :text to the
array in
rspec_on_rails/lib/spec/rails/dsl/behaviour/view_example.rb:subject_of_render
was enough to make it work.

Steve



More information about the rspec-users mailing list