[#114] Fixed test.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 20 Dec 2018 12:23:16 +0000 (15:23 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 20 Dec 2018 12:23:16 +0000 (15:23 +0300)
test/web/oauth/oauth_controller_test.exs

index 0621a8acca5a131fff7ca0cccbcba52c817f7766..52441407d14c54bf8e1150e387e381ff0ef7abdd 100644 (file)
@@ -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)