test/web_test.rb in vault-tools-0.3.8 vs test/web_test.rb in vault-tools-0.3.9

- old
+ new

@@ -40,39 +40,39 @@ # An `http_200` and an `http_2xx` log metric is written for successful # requests. def test_head_status_check head '/' - assert_match(/measure=http_200/, Scrolls.stream.string) - assert_match(/measure=http_2xx/, Scrolls.stream.string) + assert_match(/count#http_200=1/, Scrolls.stream.string) + assert_match(/count#http_2xx=1/, Scrolls.stream.string) assert_equal(200, last_response.status) end # A GET /health request logs success metrics and returns 'OK' in the # response body. def test_get_health_check get '/health' - assert_match(/measure=http_200/, Scrolls.stream.string) - assert_match(/measure=http_2xx/, Scrolls.stream.string) + assert_match(/count#http_200=1/, Scrolls.stream.string) + assert_match(/count#http_2xx=1/, Scrolls.stream.string) assert_equal(200, last_response.status) assert_equal('OK', last_response.body) end # An `http_404` and an `http_4xx` log metric is written when a path doesn't # match a known resource. def test_head_with_unknown_endpoint head '/unknown' - assert_match(/measure=http_404/, Scrolls.stream.string) - assert_match(/measure=http_4xx/, Scrolls.stream.string) + assert_match(/count#http_404=1/, Scrolls.stream.string) + assert_match(/count#http_4xx=1/, Scrolls.stream.string) assert_equal(404, last_response.status) end # An internal server error causes a `web-50` log entry to be written. A # traceback is also written to the response body to ease debugging. def test_error_logs_500 get '/boom' - assert_match(/measure=http_500/, Scrolls.stream.string) - assert_match(/measure=http_5xx/, Scrolls.stream.string) + assert_match(/count#http_500=1/, Scrolls.stream.string) + assert_match(/count#http_5xx=1/, Scrolls.stream.string) assert_match(/^RuntimeError: An expected error occurred.$/m, last_response.body) assert_equal(500, last_response.status) end