test/unit/get_template_test.rb in elasticsearch-api-1.0.11 vs test/unit/get_template_test.rb in elasticsearch-api-1.0.12

- old
+ new

@@ -17,9 +17,24 @@ end.returns(FakeResponse.new) subject.get_template :id => "foo" end + should "raise a NotFound exception" do + subject.expects(:perform_request).raises(NotFound) + + assert_raise NotFound do + subject.get_template :id => "foo" + end + end + + should "catch a NotFound exception with the ignore parameter" do + subject.expects(:perform_request).raises(NotFound) + + assert_nothing_raised do + subject.get_template :id => "foo", :ignore => 404 + end + end end end end end