diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2018-12-18 14:07:05 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2018-12-18 17:22:45 +0300 |
commit | aed0f902871524ecc1db0d8c088ce5939e7c685a (patch) | |
tree | 721be8fc2f057fcc8da719ed795dc311147a838b | |
parent | b86057cc7f45c79767ff5b83730c2c15ad6bb3bd (diff) | |
download | pleroma-aed0f902871524ecc1db0d8c088ce5939e7c685a.tar.gz |
[#114] Added `pleroma.confirmation_pending` to user views, adjusted view tests.
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/account_view.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/twitter_api/views/user_view.ex | 1 | ||||
-rw-r--r-- | test/web/mastodon_api/account_view_test.exs | 10 | ||||
-rw-r--r-- | test/web/twitter_api/views/user_view_test.exs | 20 |
4 files changed, 26 insertions, 6 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index ebcf9230b..50df88aca 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -62,6 +62,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do # Pleroma extension pleroma: %{ + confirmation_pending: user_info.confirmation_pending, tags: user.tags } } diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index 8a88d72b1..45b893eda 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -81,6 +81,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do # Pleroma extension "pleroma" => %{ + "confirmation_pending" => user_info.confirmation_pending, "tags" => user.tags } } diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index 3cb9b9c5b..fec97c700 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -55,7 +55,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do privacy: "public", sensitive: false }, - pleroma: %{tags: []} + pleroma: %{ + confirmation_pending: false, + tags: [] + } } assert expected == AccountView.render("account.json", %{user: user}) @@ -93,7 +96,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do privacy: "public", sensitive: false }, - pleroma: %{tags: []} + pleroma: %{ + confirmation_pending: false, + tags: [] + } } assert expected == AccountView.render("account.json", %{user: user}) diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 34e6d4e27..0adc69ff9 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -96,7 +96,10 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "default_scope" => "public", "no_rich_text" => false, "fields" => [], - "pleroma" => %{"tags" => []} + "pleroma" => %{ + "confirmation_pending" => false, + "tags" => [] + } } assert represented == UserView.render("show.json", %{user: user}) @@ -138,7 +141,10 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "default_scope" => "public", "no_rich_text" => false, "fields" => [], - "pleroma" => %{"tags" => []} + "pleroma" => %{ + "confirmation_pending" => false, + "tags" => [] + } } assert represented == UserView.render("show.json", %{user: user, for: follower}) @@ -181,7 +187,10 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "default_scope" => "public", "no_rich_text" => false, "fields" => [], - "pleroma" => %{"tags" => []} + "pleroma" => %{ + "confirmation_pending" => false, + "tags" => [] + } } assert represented == UserView.render("show.json", %{user: follower, for: user}) @@ -231,7 +240,10 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "default_scope" => "public", "no_rich_text" => false, "fields" => [], - "pleroma" => %{"tags" => []} + "pleroma" => %{ + "confirmation_pending" => false, + "tags" => [] + } } blocker = Repo.get(User, blocker.id) |