My RSpec capybara test is not picking up javascript/jquery functions.

I have a view page that invokes an ajax function and returns a partial to the page on form submission. But when I do an integration test with RSpec and Capybara the test by passes the ajax request and tries to load the view file corresponding to the action giving a template missing error.

it “should see payment error if payment amount is smaller than product price” do
find_link(“Canon Camera”).click
fill_in “payment_card_number”, :with => “1234567891234567″
fill_in “payment_card_name”, :with => “validname”
fill_in “payment_user_pay”, :with => 170.0
select “3″, :from => “payment_month”
select “2013″, :from => “payment_year”
page.should have_content(“There was a problem saving your order”)