On Tue, Dec 30, 2008 at 12:50 PM, s.ross <[email protected]> wrote: > > The question is: How to spec? I have spec'ed that the stuff that *will* be > injected is correctly formed. However, to fully test the code, I need to > test that the stuff that *is* injected is there. Kind of: > > response.should have_tag('script', /application.css/) > But there is no response object and that's what I'm wrestling with. > I'll betcha there's an easy solution, but I'm not seeing it.
I'd either write a simple 'dummy' request (to one of your existing controllers or make one on the fly) to catch that output, or I'd spec it as a shared behavior and include it in my other request tests wherever the behavior is needed. The first has better encapsulation if you want to split that library out later as a gem or something; the second is a little more transparent and application-focused. -- Have Fun, Steve Eley ([email protected]) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
