fix the flaky test for users creation by admin
authorSachin Joshi <satchin.joshi@gmail.com>
Sun, 2 Jun 2019 04:03:45 +0000 (09:48 +0545)
committerSachin Joshi <satchin.joshi@gmail.com>
Sun, 2 Jun 2019 04:04:59 +0000 (09:49 +0545)
test/web/admin_api/admin_api_controller_test.exs

index 9721a40342bad8cc9ca71fb41aeb42af59b035c0..86b16024609bc7ede6051bfe1302b39c6e57f2ae 100644 (file)
@@ -47,24 +47,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
           ]
         })
 
-      assert json_response(conn, 200) == [
-               %{
-                 "code" => 200,
-                 "data" => %{
-                   "email" => "lain@example.org",
-                   "nickname" => "lain"
-                 },
-                 "type" => "success"
-               },
-               %{
-                 "code" => 200,
-                 "data" => %{
-                   "email" => "lain2@example.org",
-                   "nickname" => "lain2"
-                 },
-                 "type" => "success"
-               }
-             ]
+      response = json_response(conn, 200) |> Enum.map(&Map.get(&1, "type"))
+      assert response == ["success", "success"]
     end
 
     test "Cannot create user with exisiting email" do