spec/unit/rack/formatters/json_spec.rb in goliath-1.0.3 vs spec/unit/rack/formatters/json_spec.rb in goliath-1.0.4
- old
+ new
@@ -6,11 +6,11 @@
lambda { Goliath::Rack::Formatters::JSON.new('my app') }.should_not raise_error
end
describe 'with a formatter' do
before(:each) do
- @app = mock('app').as_null_object
+ @app = double('app').as_null_object
@js = Goliath::Rack::Formatters::JSON.new(@app)
end
it 'checks content type for application/json' do
@js.json_response?({'Content-Type' => 'application/json'}).should be_true
@@ -19,10 +19,10 @@
it 'returns false for non-applicaton/json types' do
@js.json_response?({'Content-Type' => 'application/xml'}).should be_false
end
it 'calls the app with the provided environment' do
- env_mock = mock('env').as_null_object
+ env_mock = double('env').as_null_object
@app.should_receive(:call).with(env_mock).and_return([200, {}, {"a" => 1}])
@js.call(env_mock)
end
it 'formats the body into json if content-type is json' do