spec/grape_rabl_spec.rb in grape-rabl-0.0.4 vs spec/grape_rabl_spec.rb in grape-rabl-0.0.5
- old
+ new
@@ -14,12 +14,19 @@
it "should raise error about root directory" do
subject.get("/home", :rabl => true){}
lambda{ get "/home" }.should raise_error("Use Rack::Config to set 'api.tilt.root' in config.ru")
end
+
context "titl root is setup" do
before do
subject.before { env["api.tilt.root"] = "#{File.dirname(__FILE__)}/views" }
+ end
+
+ it "should respond with proper content-type" do
+ subject.get("/home", :rabl => "user"){}
+ get("/home")
+ last_response.headers["Content-Type"].should == "application/json"
end
it "should not raise error about root directory" do
subject.get("/home", :rabl => true){}
lambda{ get "/home" }.should_not raise_error("Use Rack::Config to set 'api.tilt.root' in config.ru")