summaryrefslogtreecommitdiff
path: root/test/web/oauth/app_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-08-07 09:38:05 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-08-07 09:38:05 +0300
commit1298a2ea2c63f14cc080eb549377c6a1274b1628 (patch)
treefe50b19542682173af1314766571731f69e904f5 /test/web/oauth/app_test.exs
parentb8021016ebef23903c59e5140d4efb456a84a347 (diff)
parentb9ebb55d2aabdf4c99b05efab9d4ad31b25f888d (diff)
downloadpleroma-1298a2ea2c63f14cc080eb549377c6a1274b1628.tar.gz
pleroma-1298a2ea2c63f14cc080eb549377c6a1274b1628.zip
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
# Conflicts: # mix.lock
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