help with rspec and javascript.

I want to test an action called with javascript.
The action is:

def index
unless params[:customer_full_name].blank?
   full_name = params[:customer_full_name]
   @customers = Customer.search_full_name(full_name).paginate(:per_page => 10,
       :page => params[:page])
   @customers = Customer.all.paginate(:per_page => 10, :page => params[:page])
render :layout => false if request.xhr?

In the view I have a form with a search field.
When I put values in this field it calls a javascript function.
I've tried to write this test:

require 'spec_helper'
require 'capybara/rspec'

describe CustomersController do
include Devise::TestHelpers

describe "search with js", :js => true do
   before(:each) do
     @customers = mock_model(Customer, :full_name => "User-1")

   context "when full_name is 'user'" do
     it "should find customers" do
       page.should have_content "Customers"
       page.should have_content "Dashboard"
       fill_in "customer_full_name", :with => "User"
       @full_name = "User"
       assigns(:customers).should_not be_nil

def login
   visit '/d/users/sign_in/'
   fill_in "user_email", :with => ""
   fill_in "user_password", :with => "password"
   click_button "Sign in"

def do_get page= nil, format = 'html'
   get 'index', :customer_full_name => @full_name, :format => format

Doesn't work.
Any advise?