Skip to content

Commit 1859e6f

Browse files
committed
test dashboard API
1 parent c2f7dab commit 1859e6f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
describe "dashboard" do
2+
include Rack::Test::Methods
3+
4+
def app
5+
JekyllAdmin::Server
6+
end
7+
8+
it "returns the modified site payload" do
9+
get "/dashboard"
10+
expect(last_response).to be_ok
11+
expect(last_response_parsed["site"]["posts"]).to eql(
12+
[
13+
"2016-01-01-test-post.md",
14+
"test/2016-01-02-test2.md",
15+
"2016-02-01-test-post-2.md",
16+
"2016-03-01-test-post-3.md",
17+
"more posts/2016-04-01-post-within-subdirectory.md",
18+
"more posts/some more posts/2016-05-01-a-test-post-within-subdirectory.md",
19+
"more posts/some more posts/2016-05-02-another-test-post-within-subdirectory.md",
20+
]
21+
)
22+
expect(last_response_parsed["site"]["pages"]).to eql(
23+
[
24+
"page.md",
25+
"page-dir/test/page2.md",
26+
"page-dir/page1.md",
27+
"assets/style.scss",
28+
"assets/app.coffee",
29+
]
30+
)
31+
expect(last_response_parsed["site"]["data"]).to eql(nil)
32+
expect(last_response_parsed["site"]["documents"]).to eql(nil)
33+
end
34+
end

0 commit comments

Comments
 (0)