On Fri, Jan 2, 2009 at 11:01 AM, Nasir Jamal <nas35...@yahoo.com> wrote:
>
> What is the best way to spec a controller method that involves an rjs
> redirect? Something like this

Consider:

response.should =~ /window\.location\.href = '(whatever your expected
path is)';/

I didn't confirm that regex, obviously.  But the concept is pretty
simple: if you know how the RJS redirect works and what Javascript is
supposed to be generated, then test for its presence in the response.
If it's there, your controller logic worked.



-- 
Have Fun,
   Steve Eley (sfe...@gmail.com)
   ESCAPE POD - The Science Fiction Podcast Magazine
   http://www.escapepod.org
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to