@@ -54,45 +54,46 @@ defmodule GroupherServer.Test.CMS.Search do
5454 end
5555
5656 test "search non exsit community should get empty pagi data" do
57- { :ok , searched } = CMS . search_communities ( % { title: "non-exsit" } )
57+ { :ok , searched } = CMS . search_communities ( "non-exsit" )
5858 assert searched |> is_valid_pagination? ( :raw , :empty )
5959 end
6060 end
6161
6262 describe "[cms search community]" do
6363 test "search community by full title should valid paged communities" do
64- { :ok , searched } = CMS . search_communities ( % { title: "react" } )
64+ { :ok , searched } = CMS . search_communities ( "react" )
6565
6666 assert searched |> is_valid_pagination? ( :raw )
6767 assert searched . total_count == 1
6868 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "react"
6969 end
7070
71+ @ tag :wip2
7172 test "search community blur title should return valid communities" do
72- { :ok , searched } = CMS . search_communities ( % { title: "reac" } )
73+ { :ok , searched } = CMS . search_communities ( "reac" )
7374 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "react"
7475
75- { :ok , searched } = CMS . search_communities ( % { title: "rea" } )
76+ { :ok , searched } = CMS . search_communities ( "rea" )
7677 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "react"
7778
78- { :ok , searched } = CMS . search_communities ( % { title: "eac" } )
79+ { :ok , searched } = CMS . search_communities ( "eac" )
7980 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "react"
8081
81- { :ok , searched } = CMS . search_communities ( % { title: "每日" } )
82+ { :ok , searched } = CMS . search_communities ( "每日" )
8283 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "每日妹子"
8384
84- { :ok , searched } = CMS . search_communities ( % { title: "javasc" } )
85+ { :ok , searched } = CMS . search_communities ( "javasc" )
8586 assert searched . total_count == 1
8687 assert searched . entries |> Enum . at ( 0 ) |> Map . get ( :title ) == "javascript"
8788
88- { :ok , searched } = CMS . search_communities ( % { title: "java" } )
89+ { :ok , searched } = CMS . search_communities ( "java" )
8990 assert searched . total_count == 2
9091 assert searched . entries |> Enum . any? ( & ( & 1 . title == "java" ) )
9192 assert searched . entries |> Enum . any? ( & ( & 1 . title == "javascript" ) )
9293 end
9394
9495 test "search non exsit community should get empty pagi data" do
95- { :ok , searched } = CMS . search_communities ( % { title: "non-exsit" } )
96+ { :ok , searched } = CMS . search_communities ( "non-exsit" )
9697 assert searched |> is_valid_pagination? ( :raw , :empty )
9798 end
9899 end
0 commit comments