summaryrefslogtreecommitdiff
path: root/test/unit/error_response_test.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-05-11 09:55:03 +0200
committerAzul <azul@riseup.net>2017-05-11 10:13:40 +0200
commit1f69b76ef30d9e064537e4e82b9d4f51be558afe (patch)
treeff7918907de8b6442ba3021de32679b03e0e9673 /test/unit/error_response_test.rb
parent59cf7e32ecd8c133b1ddffa40b6f104761d81738 (diff)
respond with 400 on invalid inputbugfix/400
Diffstat (limited to 'test/unit/error_response_test.rb')
-rw-r--r--test/unit/error_response_test.rb6
1 files changed, 4 insertions, 2 deletions
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