spec/unit/rack/formatters/json_spec.rb in goliath-0.9.4 vs spec/unit/rack/formatters/json_spec.rb in goliath-1.0.0.beta.1
- old
+ new
@@ -28,24 +28,24 @@
it 'formats the body into json if content-type is json' do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/json'}, {:a => 1, :b => 2}])
status, header, body = @js.call({})
- lambda { Yajl::Parser.parse(body.first)['a'].should == 1 }.should_not raise_error
+ lambda { MultiJson.load(body.first)['a'].should == 1 }.should_not raise_error
end
it "doesn't format to json if the type is not application/json" do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/xml'}, {:a => 1, :b => 2}])
- Yajl::Parser.should_not_receive(:encode)
+ MultiJson.should_not_receive(:dump)
status, header, body = @js.call({})
body[:a].should == 1
end
it 'returns the status and headers' do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/xml'}, {:a => 1, :b => 2}])
- Yajl::Parser.should_not_receive(:encode)
+ MultiJson.should_not_receive(:dump)
status, header, body = @js.call({})
status.should == 200
header.should == {'Content-Type' => 'application/xml'}
end
end