diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-17 09:24:08 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-17 09:24:08 +0300 |
commit | a879c396bb3a07929d4821ef2c29610808962c6d (patch) | |
tree | c0e64cdda3a4ab59d2fbdd25db65d8d795dba6c6 /test/web/twitter_api/util_controller_test.exs | |
parent | 22fc271e23a5dd1570ea7429b563f6edc42613c4 (diff) | |
parent | 804b961d3c8e0034c7b6057a164126e5d01a084b (diff) | |
download | pleroma-a879c396bb3a07929d4821ef2c29610808962c6d.tar.gz pleroma-a879c396bb3a07929d4821ef2c29610808962c6d.zip |
Merge branch 'develop' into feature/tag_feed
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 986ee01f3..43299e147 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -159,11 +159,31 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = Repo.get(User, user.id) - assert %{ - "followers" => false, - "follows" => true, - "non_follows" => true, - "non_followers" => true + assert %Pleroma.User.NotificationSetting{ + followers: false, + follows: true, + non_follows: true, + non_followers: true, + privacy_option: false + } == user.notification_settings + end + + test "it update notificatin privacy option", %{conn: conn} do + user = insert(:user) + + conn + |> assign(:user, user) + |> put("/api/pleroma/notification_settings", %{"privacy_option" => "1"}) + |> json_response(:ok) + + user = refresh_record(user) + + assert %Pleroma.User.NotificationSetting{ + followers: true, + follows: true, + non_follows: true, + non_followers: true, + privacy_option: true } == user.notification_settings end end @@ -878,8 +898,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do |> post("/api/pleroma/delete_account", %{"password" => "test"}) assert json_response(conn, 200) == %{"status" => "success"} - # Wait a second for the started task to end - :timer.sleep(1000) end end end |