summaryrefslogtreecommitdiff
path: root/test/web/oauth/app_test.exs
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-08-05 13:08:31 -0500
committerAlex Gleason <alex@alexgleason.me>2020-08-05 13:08:31 -0500
commitcc196e2cd57966889021342405ebc8fd0763e83a (patch)
tree232051460624a0fd0720ed04cc5512208ce1989b /test/web/oauth/app_test.exs
parentad9c925efb77287316f5dbac26f6a1b16662910a (diff)
parent7755f49e281e4990db5317b33d6b8e0d12982e0c (diff)
downloadpleroma-cc196e2cd57966889021342405ebc8fd0763e83a.tar.gz
pleroma-cc196e2cd57966889021342405ebc8fd0763e83a.zip
Merge remote-tracking branch 'upstream/develop' into restrict-domain
Diffstat (limited to 'test/web/oauth/app_test.exs')
-rw-r--r--test/web/oauth/app_test.exs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/web/oauth/app_test.exs b/test/web/oauth/app_test.exs
index 899af648e..993a490e0 100644
--- a/test/web/oauth/app_test.exs
+++ b/test/web/oauth/app_test.exs
@@ -29,5 +29,16 @@ defmodule Pleroma.Web.OAuth.AppTest do
assert exist_app.id == app.id
assert exist_app.scopes == ["read", "write", "follow", "push"]
end
+
+ test "has unique client_id" do
+ insert(:oauth_app, client_name: "", redirect_uris: "", client_id: "boop")
+
+ error =
+ catch_error(insert(:oauth_app, client_name: "", redirect_uris: "", client_id: "boop"))
+
+ assert %Ecto.ConstraintError{} = error
+ assert error.constraint == "apps_client_id_index"
+ assert error.type == :unique
+ end
end
end