@@ -11,15 +11,14 @@ defmodule GroupherServer.Test.Helper.RSSTest do
11
11
setup do
12
12
{ :ok , community } = db_insert ( :community )
13
13
{ :ok , user } = db_insert ( :user )
14
- blog_attrs = mock_attrs ( :blog , % { community_id: community . id } )
15
14
16
- { :ok , ~m( community user blog_attrs ) a }
15
+ { :ok , ~m( community user) a }
17
16
end
18
17
19
18
describe "blog curd" do
20
- @ tag :wip
21
- test "can create blog" , ~m( community user blog_attrs ) a do
22
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
19
+ @ tag :wip2
20
+ test "can create blog" , ~m( community user) a do
21
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
23
22
{ :ok , _rss_record } = CMS . create_blog_rss ( feed )
24
23
25
24
selected_feed = feed . history_feed |> List . first ( )
@@ -37,9 +36,9 @@ defmodule GroupherServer.Test.Helper.RSSTest do
37
36
assert blog . link_addr == link_addr
38
37
end
39
38
40
- @ tag :wip
41
- test "can create blog with no-exsit rss record" , ~m( community user blog_attrs ) a do
42
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
39
+ @ tag :wip2
40
+ test "can create blog with no-exsit rss record" , ~m( community user) a do
41
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
43
42
44
43
selected_feed = feed . history_feed |> List . first ( )
45
44
title = selected_feed |> Map . get ( :title )
@@ -56,12 +55,13 @@ defmodule GroupherServer.Test.Helper.RSSTest do
56
55
assert blog . link_addr == link_addr
57
56
end
58
57
59
- @ tag :wip
60
- test "can create blog with blog_author" , ~m( community user blog_attrs ) a do
61
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
58
+ @ tag :wip2
59
+ test "can create blog with blog_author" , ~m( community user) a do
60
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
62
61
63
62
author = % {
64
63
name: "mydearxym" ,
64
+ intro: "this is mydearxym" ,
65
65
link: "https://coderplaents.com"
66
66
}
67
67
@@ -86,14 +86,15 @@ defmodule GroupherServer.Test.Helper.RSSTest do
86
86
assert blog . title == title
87
87
assert blog . link_addr == link_addr
88
88
assert blog . blog_author . name == author . name
89
+ assert blog . blog_author . intro == author . intro
89
90
assert blog . blog_author . link == author . link
90
91
end
91
92
end
92
93
93
94
describe "fetch rss & curd" do
94
- @ tag :wip
95
+ @ tag :wip2
95
96
test "parse and create basic rss" do
96
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
97
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
97
98
feed = feed |> Map . merge ( % { rss: @ rss } )
98
99
99
100
{ :ok , rss_record } = CMS . create_blog_rss ( feed )
@@ -103,9 +104,9 @@ defmodule GroupherServer.Test.Helper.RSSTest do
103
104
assert not is_nil ( cache )
104
105
end
105
106
106
- @ tag :wip
107
+ @ tag :wip2
107
108
test "create rss with author" do
108
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
109
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
109
110
110
111
author = % {
111
112
name: "mydearxym" ,
@@ -121,9 +122,9 @@ defmodule GroupherServer.Test.Helper.RSSTest do
121
122
assert rss_record . author . name == "mydearxym"
122
123
end
123
124
124
- @ tag :wip
125
+ @ tag :wip2
125
126
test "update rss with author and exsit feed" do
126
- { :ok , feed } = CMS . blog_rss_feed ( @ rss )
127
+ { :ok , feed } = CMS . blog_rss_info ( @ rss )
127
128
{ :ok , rss_record } = CMS . create_blog_rss ( feed )
128
129
129
130
author = % {