On Fri, 2007-09-14 at 17:51 -0400, sinclair bain wrote: > > def update > ... > if @config.update_attributes ( params[:new_config] ) > redirect_to :action => :index > else > render :action => :edit, :id => params[:id] # this line > here > end > ... > end
> it 'should render the "edit" config url on an unsuccessful save' do > @config.should_receive(:update_attributes).once.and_return(false) > controller.expect_render( :action => :edit, :id => 1 ).once > # my prob > do_update > end I'm not sure what do_update is doing? I assume it is doing a post? In any case params are normally strings, so doing controller.expect_render(:action => :edit, :id => '1').once will most likely work. Kind regards, Hans
signature.asc
Description: This is a digitally signed message part
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users