projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/1670-user-count' into 'develop'
[akkoma]
/
test
/
web
/
push
/
impl_test.exs
diff --git
a/test/web/push/impl_test.exs
b/test/web/push/impl_test.exs
index 737976f1f635679655525a04eb5d71ff677c5245..b2664bf288501f29ae5dc40226aaf5b05ff5c473 100644
(file)
--- a/
test/web/push/impl_test.exs
+++ b/
test/web/push/impl_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push.ImplTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push.ImplTest do
@@
-63,12
+63,12
@@
defmodule Pleroma.Web.Push.ImplTest do
activity: activity
)
activity: activity
)
- assert Impl.perform(notif) ==
[:ok, :ok]
+ assert Impl.perform(notif) ==
{:ok, [:ok, :ok]}
end
@tag capture_log: true
test "returns error if notif does not match " do
end
@tag capture_log: true
test "returns error if notif does not match " do
- assert Impl.perform(%{}) ==
:error
+ assert Impl.perform(%{}) ==
{:error, :unknown_type}
end
test "successful message sending" do
end
test "successful message sending" do
@@
-98,6
+98,14
@@
defmodule Pleroma.Web.Push.ImplTest do
refute Pleroma.Repo.get(Subscription, subscription.id)
end
refute Pleroma.Repo.get(Subscription, subscription.id)
end
+ test "deletes subscription when token has been deleted" do
+ subscription = insert(:push_subscription)
+
+ Pleroma.Repo.delete(subscription.token)
+
+ refute Pleroma.Repo.get(Subscription, subscription.id)
+ end
+
test "renders title and body for create activity" do
user = insert(:user, nickname: "Bob")
test "renders title and body for create activity" do
user = insert(:user, nickname: "Bob")
@@
-162,7
+170,7
@@
defmodule Pleroma.Web.Push.ImplTest do
"<span>Lorem ipsum dolor sit amet</span>, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis."
})
"<span>Lorem ipsum dolor sit amet</span>, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis."
})
- {:ok, activity
, _} = CommonAPI.favorite(activity.id, user
)
+ {:ok, activity
} = CommonAPI.favorite(user, activity.id
)
object = Object.normalize(activity)
assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has favorited your post"
object = Object.normalize(activity)
assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has favorited your post"