Re: [rspec-users] having trouble specing an ajax request

2008-03-06 Thread Harm Aarts
Hi Namrata, I recently ran into the same problem as well. The trick was to do something like: response.should have_rjs(some_arguments) The 'some_arguments' threw me off for a while but I believe you need :chained_replace_html. I wrote a little piece on it here: http://www.rubytutorials.net

Re: [rspec-users] having trouble specing an ajax request

2008-03-05 Thread Ben Mabey
Namrata Tiwari wrote: > Sorry I pasted the wrong spec. > Here is correct one - > > it "should show deals listing" do > controller.stub!(:prepare_search_conditions).and_return(true) > Deal.should_receive(:paginate).and_return(@deals) > > get :index > controller.expect_render(:parti

Re: [rspec-users] having trouble specing an ajax request

2008-03-05 Thread Namrata Tiwari
Sorry I pasted the wrong spec. Here is correct one - it "should show deals listing" do controller.stub!(:prepare_search_conditions).and_return(true) Deal.should_receive(:paginate).and_return(@deals) get :index controller.expect_render(:partial => '/deals/front/listing') end >

[rspec-users] having trouble specing an ajax request

2008-03-05 Thread Namrata Tiwari
Do I need to spec an AR. If yes, what is the best way to spec this. here is the code - def index @deals = Deal.paginate(:all, :conditions => prepare_search_conditions, :order => 'created_at DESC', :page => params[:page] ) if request.xhr? render :update do |