Explicitely test that Bad Gateway errors result in graceful fails

Change-Id: I267fceca9e5b2ce64e01291842f3d587624bc3ac
diff --git a/tests/testthat/test-KorAPConnection.R b/tests/testthat/test-KorAPConnection.R
index 2f3d0db..a1efd9e 100644
--- a/tests/testthat/test-KorAPConnection.R
+++ b/tests/testthat/test-KorAPConnection.R
@@ -6,6 +6,10 @@
   expect_message(new("KorAPConnection", apiUrl="http://httpbin.org/delay/3", timeout = 1), "No internet|Timeout|json")
 })
 
+test_that("KorAPConnection fails gracefully on Bad Gateway errors", {
+  expect_message(new("KorAPConnection", apiUrl="http://httpbin.org/status/502", timeout = 1), "No internet|Timeout|json|502")
+})
+
 test_that("KorAPConnection is printable", {
   kco <- new("KorAPConnection", timeout = 10)
   skip_if(is.null(kco@welcome))