spec-kemal/spec/spec-kemal_spec.cr

17 lines
425 B
Crystal
Raw Normal View History

2016-04-09 14:37:46 +00:00
require "./spec_helper"
2016-04-10 14:13:25 +00:00
describe "SpecKemalApp" do
start
2016-04-09 14:37:46 +00:00
2016-04-10 14:13:25 +00:00
it "handles get" do
response = get "/"
response.body.should eq "Hello world"
end
it "handles post" do
json_body = {"name": "Serdar", "age": 27, "skills": ["crystal, kemal"]}
response = post("/user", headers: HTTP::Headers{"Content-Type": "application/json"}, body: json_body.to_json)
response.body.should eq(json_body.to_json)
2016-04-09 14:37:46 +00:00
end
end