@@ -45,7 +45,7 @@ defmodule GroupherServer.Test.CMS.ArticleCommunity.Post do
4545
4646 assert not is_nil ( Enum . find ( post . communities , & ( & 1 . id == community . id ) ) )
4747
48- { :ok , _ } = CMS . mirror_community ( :post , post . id , community2 . id )
48+ { :ok , _ } = CMS . mirror_article ( :post , post . id , community2 . id )
4949
5050 { :ok , post } = ORM . find ( CMS.Post , post . id , preload: :communities )
5151 assert post . communities |> length == 2
@@ -56,13 +56,13 @@ defmodule GroupherServer.Test.CMS.ArticleCommunity.Post do
5656 test "post can be unmirror from community" ,
5757 ~m( user community community2 community3 post_attrs) a do
5858 { :ok , post } = CMS . create_article ( community , :post , post_attrs , user )
59- { :ok , _ } = CMS . mirror_community ( :post , post . id , community2 . id )
60- { :ok , _ } = CMS . mirror_community ( :post , post . id , community3 . id )
59+ { :ok , _ } = CMS . mirror_article ( :post , post . id , community2 . id )
60+ { :ok , _ } = CMS . mirror_article ( :post , post . id , community3 . id )
6161
6262 { :ok , post } = ORM . find ( CMS.Post , post . id , preload: :communities )
6363 assert post . communities |> length == 3
6464
65- { :ok , _ } = CMS . unmirror_community ( :post , post . id , community3 . id )
65+ { :ok , _ } = CMS . unmirror_article ( :post , post . id , community3 . id )
6666 { :ok , post } = ORM . find ( CMS.Post , post . id , preload: :communities )
6767 assert post . communities |> length == 2
6868
@@ -72,14 +72,14 @@ defmodule GroupherServer.Test.CMS.ArticleCommunity.Post do
7272 test "post can not unmirror from original community" ,
7373 ~m( user community community2 community3 post_attrs) a do
7474 { :ok , post } = CMS . create_article ( community , :post , post_attrs , user )
75- { :ok , _ } = CMS . mirror_community ( :post , post . id , community2 . id )
76- { :ok , _ } = CMS . mirror_community ( :post , post . id , community3 . id )
75+ { :ok , _ } = CMS . mirror_article ( :post , post . id , community2 . id )
76+ { :ok , _ } = CMS . mirror_article ( :post , post . id , community3 . id )
7777
7878 { :ok , post } = ORM . find ( CMS.Post , post . id , preload: :communities )
7979 assert post . communities |> length == 3
8080
81- { :error , reason } = CMS . unmirror_community ( :post , post . id , community . id )
82- assert reason |> is_error? ( :mirror_community )
81+ { :error , reason } = CMS . unmirror_article ( :post , post . id , community . id )
82+ assert reason |> is_error? ( :mirror_article )
8383 end
8484 end
8585end
0 commit comments