Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 7165d64

Browse files
committed
refactor(notify): clean up
1 parent 46c27fc commit 7165d64

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

test/groupher_server/accounts/mailbx_test.exs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,11 @@ defmodule GroupherServer.Test.Accounts.Mailbox do
1111
{:ok, user2} = db_insert(:user)
1212
{:ok, user3} = db_insert(:user)
1313

14-
notify_attrs = %{
15-
thread: :post,
16-
article_id: post.id,
17-
title: post.title,
18-
action: :upvote,
19-
user_id: user.id,
20-
read: false
21-
}
22-
23-
{:ok, ~m(post user user2 user3 notify_attrs)a}
14+
{:ok, ~m(post user user2 user3)a}
2415
end
2516

2617
describe "mailbox status" do
27-
@tag :wip2
28-
test "can get mailbox status", ~m(post user user2 notify_attrs)a do
18+
test "can get mailbox status", ~m(post user user2)a do
2919
notify_attrs = %{
3020
thread: :post,
3121
article_id: post.id,

test/groupher_server/delivery/mention_test.exs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
2727
end
2828

2929
describe "mentions" do
30-
@tag :wip2
3130
test "can get unread mention count of a user", ~m(post user user2 user3 mention_attr)a do
3231
mention_contents = [
3332
Map.merge(mention_attr, %{from_user_id: user.id, to_user_id: user3.id})
@@ -45,7 +44,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
4544
assert count == 2
4645
end
4746

48-
@tag :wip2
4947
test "can batch send mentions", ~m(post user user2 mention_attr)a do
5048
mention_contents = [
5149
Map.merge(mention_attr, %{from_user_id: user.id, to_user_id: user2.id})
@@ -61,7 +59,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
6159
assert mention.user.login == user.login
6260
end
6361

64-
@tag :wip2
6562
test "mention multiable times on same article, will only have one record",
6663
~m(post user user2 mention_attr)a do
6764
mention_contents = [
@@ -79,7 +76,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
7976
assert result.total_count == 1
8077
end
8178

82-
@tag :wip2
8379
test "if mention before, update with no mention content will not do mention in final",
8480
~m(post user user2 user3 mention_attr)a do
8581
mention_contents = [
@@ -108,7 +104,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
108104
end
109105

110106
describe "mark read" do
111-
@tag :wip
112107
test "can mark read a mention", ~m(post user user2 mention_attr)a do
113108
mention_contents = [
114109
Map.merge(mention_attr, %{from_user_id: user.id, to_user_id: user2.id})
@@ -126,7 +121,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
126121
assert mention.read
127122
end
128123

129-
@tag :wip
130124
test "can mark multi mention as read", ~m(post user user2 user3 mention_attr)a do
131125
mention_contents = [
132126
Map.merge(mention_attr, %{from_user_id: user2.id, to_user_id: user.id})
@@ -155,7 +149,6 @@ defmodule GroupherServer.Test.Delivery.Mention do
155149
assert mention2.read
156150
end
157151

158-
@tag :wip
159152
test "can mark read all", ~m(post user user2 user3 mention_attr)a do
160153
mention_contents = [
161154
Map.merge(mention_attr, %{from_user_id: user2.id, to_user_id: user.id})

test/groupher_server/delivery/notification_test.exs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ defmodule GroupherServer.Test.Delivery.Notification do
8080
end
8181

8282
describe "notification" do
83-
@tag :wip2
8483
test "can get unread notification count of a user", ~m(user user2 user3 notify_attrs)a do
8584
{:ok, _} = Delivery.send(:notify, notify_attrs, user2)
8685
{:ok, _} = Delivery.send(:notify, notify_attrs, user3)
@@ -341,7 +340,6 @@ defmodule GroupherServer.Test.Delivery.Notification do
341340
end
342341

343342
describe "mark read" do
344-
@tag :wip
345343
test "can mark multi notification as read", ~m(user user2 user3 notify_attrs)a do
346344
{:ok, notify} = Delivery.send(:notify, notify_attrs, user2)
347345
move_insert_at_long_ago(notify)
@@ -362,7 +360,6 @@ defmodule GroupherServer.Test.Delivery.Notification do
362360
assert result.total_count == 2
363361
end
364362

365-
@tag :wip
366363
test "can mark all notification as read", ~m(user user2 user3 notify_attrs)a do
367364
{:ok, notify} = Delivery.send(:notify, notify_attrs, user2)
368365
move_insert_at_long_ago(notify)

0 commit comments

Comments
 (0)