Update test for custom fields when name empty string

This commit is contained in:
kPherox 2019-08-26 03:25:06 +09:00
parent b15e226593
commit b8777b01ae
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D

View File

@ -364,6 +364,21 @@ test "update fields", %{conn: conn} do
|> assign(:user, user)
|> patch("/api/v1/accounts/update_credentials", %{"fields_attributes" => fields})
|> json_response(403)
fields = [
%{"name" => "foo", "value" => ""},
%{"name" => "", "value" => "bar"}
]
account =
conn
|> assign(:user, user)
|> patch("/api/v1/accounts/update_credentials", %{"fields_attributes" => fields})
|> json_response(200)
assert account["fields"] == [
%{"name" => "foo", "value" => ""}
]
end
end
end