[rspec-users] problems testing a rails controller

David Chelimsky dchelimsky at gmail.com
Thu Jan 18 18:09:53 EST 2007

On 1/18/07, Jay Donnell <jaydonnell at yahoo.com> wrote:
> "Mmm... You're posting to the action 'search.rjs', but
> what you want to
> test is the action 'search'"
> My understanding is that the new restful stuff in edge
> rails (i.e. the respond_to) method will use the
> extension to determine which output type to use. This
> code runs fine outside of the tests and I am using
> urls with extensions.
> What is the usual way to test various respond_to
> output types from rspec?

This bit looks odd:

respond_to do |format|
  format.js { render :action => "search.rjs" }

I think you'd want to either render :template => 'seach.rjs' or just
say format.js (and the rjs template would be rendered implicitly, no?)

> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list