0
0
zero/spec/unit/controller/render_spec.rb
Gibheer b20c0c527c reuse render for actual rendering
The splitting of rendering and processing is good, but on the other side
it makes some double steps or even introduce workarounds.
That is why I made the method #render just a call to the renderer. This
should help much more than the strict seperation.

The method will only return the resulting string and not add it to the
body of the response. That still has to be taken care of by the user.
2012-12-18 04:24:24 +01:00

20 lines
493 B
Ruby

require 'spec_helper'
describe Zero::Controller, '#render' do
subject { Zero::Controller.new(env) }
let(:env) { EnvGenerator.get('/foo') }
let(:renderer) { mock }
let(:template) { '/foo' }
before :each do
Zero::Controller.renderer = renderer
renderer.should_receive(:render).with(template,
kind_of(Zero::Request::AcceptType), subject)
end
after :each do
Zero::Controller.renderer = nil
end
it { subject.render(template) }
end