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
|
2016-04-18 13:51:50 +00:00
|
|
|
get "/"
|
2016-04-10 14:13:25 +00:00
|
|
|
response.body.should eq "Hello world"
|
|
|
|
end
|
|
|
|
|
|
|
|
it "handles post" do
|
|
|
|
json_body = {"name": "Serdar", "age": 27, "skills": ["crystal, kemal"]}
|
2016-09-06 03:21:24 +00:00
|
|
|
post("/user", headers: HTTP::Headers{"Content-Type" => "application/json"}, body: json_body.to_json)
|
2016-04-10 14:13:25 +00:00
|
|
|
response.body.should eq(json_body.to_json)
|
2016-04-09 14:37:46 +00:00
|
|
|
end
|
|
|
|
end
|