Skip to content

Commit a04644e

Browse files
committed
test dashboard API
1 parent c2f7dab commit a04644e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 include("assets/style.scss")
23+
expect(last_response_parsed["site"]["data"]).to eql(nil)
24+
expect(last_response_parsed["site"]["documents"]).to eql(nil)
25+
end
26+
end

0 commit comments

Comments
 (0)