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
/
notification_view_test.exs
diff --git
a/test/web/twitter_api/views/notification_view_test.exs
b/test/web/twitter_api/views/notification_view_test.exs
index 33aaa89e114e741cd8f5d05277f1b1508f961b30..79eafda7d4e071fd6857cbbf86c37c454dc9328e 100644
(file)
--- a/
test/web/twitter_api/views/notification_view_test.exs
+++ b/
test/web/twitter_api/views/notification_view_test.exs
@@
-24,7
+24,7
@@
defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do
{:ok, follower} = User.follow(follower, user)
{:ok, activity} = ActivityPub.follow(follower, user)
{:ok, follower} = User.follow(follower, user)
{:ok, activity} = ActivityPub.follow(follower, 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)))
[follow_notif] = Notification.for_user(user)
represented = %{
[follow_notif] = Notification.for_user(user)
represented = %{
@@
-36,14
+36,17
@@
defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do
"ntype" => "follow"
}
"ntype" => "follow"
}
- assert represented == NotificationView.render("notification.json", %{notification: follow_notif, for: user})
+ assert represented ==
+ NotificationView.render("notification.json", %{notification: follow_notif, for: user})
end
test "A mention notification" do
user = insert(:user)
other_user = insert(:user)
end
test "A mention notification" do
user = insert(:user)
other_user = insert(:user)
- {:ok, activity} = TwitterAPI.create_status(other_user, %{"status" => "Päivää, @#{user.nickname}"})
+ {:ok, activity} =
+ TwitterAPI.create_status(other_user, %{"status" => "Päivää, @#{user.nickname}"})
+
[notification] = Notification.for_user(user)
represented = %{
[notification] = Notification.for_user(user)
represented = %{
@@
-55,7
+58,8
@@
defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do
"ntype" => "mention"
}
"ntype" => "mention"
}
- assert represented == NotificationView.render("notification.json", %{notification: notification, for: user})
+ assert represented ==
+ NotificationView.render("notification.json", %{notification: notification, for: user})
end
test "A retweet notification" do
end
test "A retweet notification" do
@@
-71,11
+75,13
@@
defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do
"from_profile" => UserView.render("show.json", %{user: repeater, for: user}),
"id" => notification.id,
"is_seen" => 0,
"from_profile" => UserView.render("show.json", %{user: repeater, for: user}),
"id" => notification.id,
"is_seen" => 0,
- "notice" => ActivityView.render("activity.json", %{activity: notification.activity, for: user}),
+ "notice" =>
+ ActivityView.render("activity.json", %{activity: notification.activity, for: user}),
"ntype" => "repeat"
}
"ntype" => "repeat"
}
- assert represented == NotificationView.render("notification.json", %{notification: notification, for: user})
+ assert represented ==
+ NotificationView.render("notification.json", %{notification: notification, for: user})
end
test "A like notification" do
end
test "A like notification" do
@@
-91,10
+97,12
@@
defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do
"from_profile" => UserView.render("show.json", %{user: liker, for: user}),
"id" => notification.id,
"is_seen" => 0,
"from_profile" => UserView.render("show.json", %{user: liker, for: user}),
"id" => notification.id,
"is_seen" => 0,
- "notice" => ActivityView.render("activity.json", %{activity: notification.activity, for: user}),
+ "notice" =>
+ ActivityView.render("activity.json", %{activity: notification.activity, for: user}),
"ntype" => "like"
}
"ntype" => "like"
}
- assert represented == NotificationView.render("notification.json", %{notification: notification, for: user})
+ assert represented ==
+ NotificationView.render("notification.json", %{notification: notification, for: user})
end
end
end
end