]> granicus.if.org Git - ejabberd/commitdiff
Fix mod_http_apt_test
authorPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 9 Nov 2018 13:55:19 +0000 (14:55 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 9 Nov 2018 13:55:19 +0000 (14:55 +0100)
test/mod_http_api_test.exs

index 29405a3ec57b23fa558b7013c10f21ebdb0c002a..f7abbc004f93b5208b1a93480329172170826a8d 100644 (file)
@@ -61,15 +61,15 @@ defmodule ModHttpApiTest do
   test "Attempting to access a command that is not exposed as HTTP API returns 403" do
     setup_mocks()
     assert :ok == :ejabberd_commands.expose_commands([])
-    request = request(method: :POST, ip: {{127,0,0,1},50000}, data: "[]")
+    request = request(method: :POST, ip: {{127,0,0,1},50000}, data: "{}")
     {403, _, _} = :mod_http_api.process(["open_cmd"], request)
   end
 
   test "Call to user, admin or restricted commands without authentication are rejected" do
     setup_mocks()
     assert :ok == :ejabberd_commands.expose_commands([:user_cmd, :admin_cmd, :restricted])
-    request = request(method: :POST, ip: {{127,0,0,1},50000}, data: "[]")
-    {403, _, _} = :mod_http_api.process(["user_cmd"], request)
+    request = request(method: :POST, ip: {{127,0,0,1},50000}, data: "{}")
+    {400, _, _} = :mod_http_api.process(["user_cmd"], request)
     {403, _, _} = :mod_http_api.process(["admin_cmd"], request)
     {403, _, _} = :mod_http_api.process(["restricted_cmd"], request)
   end