aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2018-12-20 15:23:16 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2018-12-20 15:23:16 +0300
commit851db74f1ca533f27f72f1341571948b15d2f561 (patch)
treeb6c1c067d9834ca27dde12448420a13522cfcd9b
parent7cab7de9ff0432a582cfca0852a4b66fdd124c41 (diff)
downloadpleroma-851db74f1ca533f27f72f1341571948b15d2f561.tar.gz
[#114] Fixed test.
-rw-r--r--test/web/oauth/oauth_controller_test.exs9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/web/oauth/oauth_controller_test.exs b/test/web/oauth/oauth_controller_test.exs
index 0621a8acc..52441407d 100644
--- a/test/web/oauth/oauth_controller_test.exs
+++ b/test/web/oauth/oauth_controller_test.exs
@@ -113,7 +113,14 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
refute Map.has_key?(resp, "access_token")
end
- test "rejects token exchange for valid credentials belonging to unconfirmed user" do
+ test "rejects token exchange for valid credentials belonging to unconfirmed user and confirmation is required" do
+ setting = Pleroma.Config.get([:instance, :account_activation_required])
+
+ unless setting do
+ Pleroma.Config.put([:instance, :account_activation_required], true)
+ on_exit(fn -> Pleroma.Config.put([:instance, :account_activation_required], setting) end)
+ end
+
password = "testpassword"
user = insert(:user, password_hash: Comeonin.Pbkdf2.hashpwsalt(password))
info_change = Pleroma.User.Info.confirmation_changeset(user.info, :unconfirmed)