@@ -24,48 +24,48 @@ defmodule GroupherServer.Test.CMS.Hooks.AuditPost do
24
24
end
25
25
26
26
describe "[audit post basic]" do
27
- test "ugly words shoud get audit" , ~m( user community post_attrs) a do
28
- body = mock_rich_text ( "M卖批, 这也太操蛋了, 党中央" )
27
+ # test "ugly words shoud get audit", ~m(user community post_attrs)a do
28
+ # body = mock_rich_text("M卖批, 这也太操蛋了, 党中央")
29
29
30
- post_attrs = post_attrs |> Map . merge ( % { body: body } )
31
- { :ok , post } = CMS . create_article ( community , :post , post_attrs , user )
30
+ # post_attrs = post_attrs |> Map.merge(%{body: body})
31
+ # {:ok, post} = CMS.create_article(community, :post, post_attrs, user)
32
32
33
- Hooks.Audition . handle ( post )
33
+ # Hooks.Audition.handle(post)
34
34
35
- { :ok , post } = ORM . find ( CMS.Model.Post , post . id )
35
+ # {:ok, post} = ORM.find(CMS.Model.Post, post.id)
36
36
37
- assert post . pending == @ audit_illegal
38
- assert post . meta . is_legal == false
39
- assert post . meta . illegal_reason == [ "政治敏感" , "低俗辱骂" ]
40
- assert post . meta . illegal_words == [ "党中央" , "操蛋" , "卖批" ]
41
- end
37
+ # assert post.pending == @audit_illegal
38
+ # assert post.meta.is_legal == false
39
+ # assert post.meta.illegal_reason == ["政治敏感", "低俗辱骂"]
40
+ # assert post.meta.illegal_words == ["党中央", "操蛋", "卖批"]
41
+ # end
42
42
43
- test "normal words shoud not get audit" , ~m( user community post_attrs) a do
44
- body = mock_rich_text ( "世界属于三体" )
43
+ # test "normal words shoud not get audit", ~m(user community post_attrs)a do
44
+ # body = mock_rich_text("世界属于三体")
45
45
46
- post_attrs = post_attrs |> Map . merge ( % { body: body } )
47
- { :ok , post } = CMS . create_article ( community , :post , post_attrs , user )
46
+ # post_attrs = post_attrs |> Map.merge(%{body: body})
47
+ # {:ok, post} = CMS.create_article(community, :post, post_attrs, user)
48
48
49
- Hooks.Audition . handle ( post )
49
+ # Hooks.Audition.handle(post)
50
50
51
- { :ok , post } = ORM . find ( CMS.Model.Post , post . id )
51
+ # {:ok, post} = ORM.find(CMS.Model.Post, post.id)
52
52
53
- assert post . pending == @ audit_legal
54
- assert post . meta . is_legal == true
55
- assert post . meta . illegal_reason == [ ]
56
- assert post . meta . illegal_words == [ ]
57
- end
53
+ # assert post.pending == @audit_legal
54
+ # assert post.meta.is_legal == true
55
+ # assert post.meta.illegal_reason == []
56
+ # assert post.meta.illegal_words == []
57
+ # end
58
58
59
- test "failed audit should have falied state" , ~m( user community post_attrs) a do
60
- body = mock_rich_text ( "世界属于三体" )
59
+ # test "failed audit should have falied state", ~m(user community post_attrs)a do
60
+ # body = mock_rich_text("世界属于三体")
61
61
62
- post_attrs = post_attrs |> Map . merge ( % { body: body } )
63
- { :ok , post } = CMS . create_article ( community , :post , post_attrs , user )
62
+ # post_attrs = post_attrs |> Map.merge(%{body: body})
63
+ # {:ok, post} = CMS.create_article(community, :post, post_attrs, user)
64
64
65
- Hooks.Audition . handle_edge ( post )
65
+ # Hooks.Audition.handle_edge(post)
66
66
67
- { :ok , post } = ORM . find ( CMS.Model.Post , post . id )
68
- assert post . pending == @ audit_failed
69
- end
67
+ # {:ok, post} = ORM.find(CMS.Model.Post, post.id)
68
+ # assert post.pending == @audit_failed
69
+ # end
70
70
end
71
71
end
0 commit comments