initialize the response
This commit is contained in:
parent
e437deee34
commit
2353a579ca
|
@ -50,7 +50,7 @@ module Zero
|
|||
# @param env [Hash] a rack compatible environment
|
||||
def initialize(env)
|
||||
@request = self.class.request.new(env)
|
||||
@response = self.class.response
|
||||
@response = self.class.response.new
|
||||
@renderer = self.class.renderer
|
||||
end
|
||||
|
||||
|
|
|
@ -24,4 +24,18 @@ describe Zero::Controller, '.call' do
|
|||
r = Zero::Request.new(env)
|
||||
expect(r.params['foo']).to eq('bar')
|
||||
end
|
||||
|
||||
context "with the response" do
|
||||
let(:response_class) { mock }
|
||||
before :each do
|
||||
Zero::Controller.response = response_class
|
||||
response_class.should_receive(:new)
|
||||
end
|
||||
|
||||
after :each do
|
||||
Zero::Controller.response = nil
|
||||
end
|
||||
|
||||
it { subject }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue