[rspec-users] rspecing rjs - form.reset('form')

s.ross cwdinfo at gmail.com
Thu Dec 11 03:26:04 EST 2008

On Dec 10, 2008, at 10:27 AM, Andrei Erdoss wrote:

> Hello,
> I couldn't find much info on this.
> How do you rspec this: page.form.reset("form")
> I looked in the have_rjs source code and I can't find anything on  
> form reset.
> Thanks,
> -- 
> Andrei

I tend not to use rjs much, but what I suspect you are looking for is  
the response to contain a particular snippet of Javascript. So, it  
might look sort of like:

it "should send Javascript to reset the form" do
   post :action_that_resets_the_form
   response.should have_text(/$('form').reset()/)

Does this sound like what you are looking for?

More information about the rspec-users mailing list