summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/dispatcher_test.rb2
-rw-r--r--test/unit/error_response_test.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/test/integration/dispatcher_test.rb b/test/integration/dispatcher_test.rb
index b551e87..b2582bd 100644
--- a/test/integration/dispatcher_test.rb
+++ b/test/integration/dispatcher_test.rb
@@ -123,7 +123,7 @@ class Nickserver::DispatcherTest < Minitest::Test
end
def error(msg)
- response status: 500, content: "500 #{msg}\n"
+ response status: 400, content: JSON.generate(error: msg)
end
def http_connection_error
diff --git a/test/unit/error_response_test.rb b/test/unit/error_response_test.rb
index 7242b38..2efe533 100644
--- a/test/unit/error_response_test.rb
+++ b/test/unit/error_response_test.rb
@@ -1,12 +1,14 @@
require 'test_helper'
require 'nickserver/error_response'
+require 'json'
class ErrorResponseTest < Minitest::Test
def test_content
response = Nickserver::ErrorResponse.new "Not a valid address"
- assert_equal "500 Not a valid address\n", response.content
- assert_equal 500, response.status
+ assert_equal 400, response.status
+ assert_equal JSON.generate(error: "Not a valid address"),
+ response.content
end
end