projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TwitterAPI user view: add screen_name_html and description_html.
[akkoma]
/
test
/
web
/
twitter_api
/
views
/
user_view_test.exs
diff --git
a/test/web/twitter_api/views/user_view_test.exs
b/test/web/twitter_api/views/user_view_test.exs
index dd55c0b7e421ff63c3e0669361d45c1e4a3380fe..000c589afff4cf78bad313faa3a64b139512548e 100644
(file)
--- a/
test/web/twitter_api/views/user_view_test.exs
+++ b/
test/web/twitter_api/views/user_view_test.exs
@@
-31,7
+31,7
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
User.follow(second_follower, user)
User.follow(user, follower)
{:ok, user} = User.update_follower_count(user)
User.follow(second_follower, user)
User.follow(user, follower)
{:ok, user} = User.update_follower_count(user)
- Cachex.
se
t(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id)))
+ Cachex.
pu
t(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id)))
image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/images/banner.png"
image = "http://localhost:4001/images/avi.png"
banner = "http://localhost:4001/images/banner.png"
@@
-40,7
+40,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
+ "screen_name_html" => user.nickname,
"description" => HtmlSanitizeEx.strip_tags(user.bio),
"description" => HtmlSanitizeEx.strip_tags(user.bio),
+ "description_html" => HtmlSanitizeEx.strip_tags(user.bio),
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 1,
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 1,
@@
-59,7
+61,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
- "is_local" => true
+ "is_local" => true,
+ "locked" => false,
+ "default_scope" => "public"
}
assert represented == UserView.render("show.json", %{user: user})
}
assert represented == UserView.render("show.json", %{user: user})
@@
-75,7
+79,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
+ "screen_name_html" => user.nickname,
"description" => HtmlSanitizeEx.strip_tags(user.bio),
"description" => HtmlSanitizeEx.strip_tags(user.bio),
+ "description_html" => HtmlSanitizeEx.strip_tags(user.bio),
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
@@
-94,7
+100,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
- "is_local" => true
+ "is_local" => true,
+ "locked" => false,
+ "default_scope" => "public"
}
assert represented == UserView.render("show.json", %{user: user, for: follower})
}
assert represented == UserView.render("show.json", %{user: user, for: follower})
@@
-111,7
+119,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"id" => follower.id,
"name" => follower.name,
"screen_name" => follower.nickname,
"id" => follower.id,
"name" => follower.name,
"screen_name" => follower.nickname,
+ "screen_name_html" => follower.nickname,
"description" => HtmlSanitizeEx.strip_tags(follower.bio),
"description" => HtmlSanitizeEx.strip_tags(follower.bio),
+ "description_html" => HtmlSanitizeEx.strip_tags(follower.bio),
"created_at" => follower.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
"created_at" => follower.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
@@
-130,7
+140,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"statusnet_profile_url" => follower.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"statusnet_profile_url" => follower.ap_id,
"cover_photo" => banner,
"background_image" => nil,
- "is_local" => true
+ "is_local" => true,
+ "locked" => false,
+ "default_scope" => "public"
}
assert represented == UserView.render("show.json", %{user: follower, for: user})
}
assert represented == UserView.render("show.json", %{user: follower, for: user})
@@
-154,7
+166,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
"id" => user.id,
"name" => user.name,
"screen_name" => user.nickname,
+ "screen_name_html" => user.nickname,
"description" => HtmlSanitizeEx.strip_tags(user.bio),
"description" => HtmlSanitizeEx.strip_tags(user.bio),
+ "description_html" => HtmlSanitizeEx.strip_tags(user.bio),
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"favourites_count" => 0,
"statuses_count" => 0,
@@
-173,7
+187,9
@@
defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
- "is_local" => true
+ "is_local" => true,
+ "locked" => false,
+ "default_scope" => "public"
}
blocker = Repo.get(User, blocker.id)
}
blocker = Repo.get(User, blocker.id)