Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit1bf1976

Browse files
committed
refactor(mailbox): fix tests
1 parentc85886f commit1bf1976

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

‎test/groupher_server/cms/hooks/notify_blog_test.exs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyBlog do
33

44
importGroupherServer.CMS.Delegate.Helper,only:[preload_author:1]
55

6-
aliasGroupherServer.{CMS,Delivery}
6+
aliasGroupherServer.{CMS,Delivery,Repo}
77
aliasCMS.Delegate.Hooks
88

99
setupdo
@@ -149,8 +149,8 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyBlog do
149149

150150
Hooks.Notify.handle(:reply,replyed_comment,user3)
151151

152-
{:ok,notifications}=
153-
Delivery.fetch(:notification,comment.author_id,%{page:1,size:20})
152+
comment=Repo.preload(comment,:author)
153+
{:ok,notifications}=Delivery.fetch(:notification,comment.author,%{page:1,size:20})
154154

155155
assertnotifications.total_count==1
156156

‎test/groupher_server/cms/hooks/notify_job_test.exs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyJob do
33

44
importGroupherServer.CMS.Delegate.Helper,only:[preload_author:1]
55

6-
aliasGroupherServer.{CMS,Delivery}
6+
aliasGroupherServer.{CMS,Delivery,Repo}
77
aliasCMS.Delegate.Hooks
88

99
setupdo
@@ -81,7 +81,6 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyJob do
8181
Hooks.Notify.handle(:undo,:upvote,comment,user2)
8282

8383
{:ok,comment}=preload_author(comment)
84-
8584
{:ok,notifications}=Delivery.fetch(:notification,comment.author,%{page:1,size:20})
8685

8786
assertnotifications.total_count==0
@@ -149,8 +148,8 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyJob do
149148

150149
Hooks.Notify.handle(:reply,replyed_comment,user3)
151150

152-
{:ok,notifications}=
153-
Delivery.fetch(:notification,comment.author_id,%{page:1,size:20})
151+
comment=Repo.preload(comment,:author)
152+
{:ok,notifications}=Delivery.fetch(:notification,comment.author,%{page:1,size:20})
154153

155154
assertnotifications.total_count==1
156155

‎test/groupher_server/cms/hooks/notify_post_test.exs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyPost do
33

44
importGroupherServer.CMS.Delegate.Helper,only:[preload_author:1]
55

6-
aliasGroupherServer.{CMS,Delivery}
6+
aliasGroupherServer.{CMS,Delivery,Repo}
77
aliasCMS.Delegate.Hooks
88

99
setupdo
@@ -149,8 +149,8 @@ defmodule GroupherServer.Test.CMS.Hooks.NotifyPost do
149149

150150
Hooks.Notify.handle(:reply,replyed_comment,user3)
151151

152-
{:ok,notifications}=
153-
Delivery.fetch(:notification,comment.author_id,%{page:1,size:20})
152+
comment=Repo.preload(comment,:author)
153+
{:ok,notifications}=Delivery.fetch(:notification,comment.author,%{page:1,size:20})
154154

155155
assertnotifications.total_count==1
156156

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp