1
1
defmodule GroupherServer.Test.CMS.ContentFlags do
2
+ @ moduledoc false
3
+
2
4
use GroupherServer.TestTools
3
5
4
6
alias GroupherServer.CMS
5
7
6
8
alias CMS . {
7
- Post ,
8
9
PostCommunityFlag ,
9
- Repo ,
10
10
RepoCommunityFlag ,
11
- Job ,
12
11
JobCommunityFlag ,
13
- Video ,
14
12
VideoCommunityFlag
15
13
}
16
14
@@ -35,7 +33,7 @@ defmodule GroupherServer.Test.CMS.ContentFlags do
35
33
{ :ok , found } = PostCommunityFlag |> ORM . find_by ( ~m( post_id community_id) a )
36
34
assert found . trash == false
37
35
38
- CMS . set_community_flags ( % Post { id: post . id } , community . id , % { trash: true } )
36
+ CMS . set_community_flags ( community , post , % { trash: true } )
39
37
40
38
{ :ok , found } = PostCommunityFlag |> ORM . find_by ( ~m( post_id community_id) a )
41
39
@@ -55,7 +53,7 @@ defmodule GroupherServer.Test.CMS.ContentFlags do
55
53
{ :ok , found } = JobCommunityFlag |> ORM . find_by ( ~m( job_id community_id) a )
56
54
assert found . trash == false
57
55
58
- CMS . set_community_flags ( % Job { id: job . id } , community . id , % { trash: true } )
56
+ CMS . set_community_flags ( community , job , % { trash: true } )
59
57
60
58
{ :ok , found } = JobCommunityFlag |> ORM . find_by ( ~m( job_id community_id) a )
61
59
@@ -73,7 +71,7 @@ defmodule GroupherServer.Test.CMS.ContentFlags do
73
71
{ :ok , found } = VideoCommunityFlag |> ORM . find_by ( ~m( video_id community_id) a )
74
72
assert found . trash == false
75
73
76
- CMS . set_community_flags ( % Video { id: video . id } , community . id , % { trash: true } )
74
+ CMS . set_community_flags ( community , video , % { trash: true } )
77
75
78
76
{ :ok , found } = VideoCommunityFlag |> ORM . find_by ( ~m( video_id community_id) a )
79
77
@@ -91,7 +89,7 @@ defmodule GroupherServer.Test.CMS.ContentFlags do
91
89
{ :ok , found } = RepoCommunityFlag |> ORM . find_by ( ~m( repo_id community_id) a )
92
90
assert found . trash == false
93
91
94
- CMS . set_community_flags ( % Repo { id: repo . id } , community . id , % { trash: true } )
92
+ CMS . set_community_flags ( community , repo , % { trash: true } )
95
93
96
94
{ :ok , found } = RepoCommunityFlag |> ORM . find_by ( ~m( repo_id community_id) a )
97
95
0 commit comments