test/unit/delete_document_test.rb in elasticsearch-api-1.0.11 vs test/unit/delete_document_test.rb in elasticsearch-api-1.0.12
- old
+ new
@@ -60,14 +60,22 @@
end.returns(FakeResponse.new)
subject.delete :index => 'foo^bar', :type => 'bar/bam', :id => 1
end
+ should "raise a NotFound exception" do
+ subject.expects(:perform_request).raises(NotFound)
+
+ assert_raise NotFound do
+ subject.delete :index => 'foo', :type => 'bar', :id => 'XXX'
+ end
+ end
+
should "catch a NotFound exception with the ignore parameter" do
subject.expects(:perform_request).raises(NotFound)
assert_nothing_raised do
- subject.get :index => 'foo', :type => 'bar', :id => 'XXX', :ignore => 404
+ subject.delete :index => 'foo', :type => 'bar', :id => 'XXX', :ignore => 404
end
end
end