spec/respond_with_spec.rb in sinatra-contrib-1.3.2 vs spec/respond_with_spec.rb in sinatra-contrib-1.4.0
- old
+ new
@@ -1,6 +1,8 @@
require 'backports'
+require 'multi_json'
+
require_relative 'spec_helper'
require_relative 'okjson'
describe Sinatra::RespondWith do
def provides(*args)
@@ -223,9 +225,17 @@
object = {:name => 'World'}
def object.to_pdf; "hi" end
respond_with :foo, object
req(:pdf).should be_ok
body.should == "hi"
+ end
+
+ unless defined? JRUBY_VERSION
+ it 'uses yajl for json' do
+ respond_with :baz
+ req(:json).should be_ok
+ body.should == "\"yajl!\""
+ end
end
end
describe 'customizing' do
it 'allows customizing' do