views:

43

answers:

0

I am using rails 2.3.5 and here is the main action in my controller.

@klass.paginated_each(:conditions => @cond ) do |record|
 klass.send(:delete, record)
end

Here is my functional test with shoulda and flexmock

context 'xhr advance_search with delete_all action' do
   setup do
     flexmock(Article).new_instances.should_receive(:delete).once
     xml_http_request  :post,
                       :advance_search, {:klass => Article.name.underscore, 
                                         :query => 'ruby'} }
                           }
   end
   should_respond_with :success
 end

Where do I put my assert statement to ensure that all delete operation was performed on all the records of that class.