0
0
Fork 0

don't overwrite the request

This commit is contained in:
Gibheer 2012-11-29 22:22:21 +01:00
parent 74bbc7f186
commit 9cea623595
2 changed files with 9 additions and 1 deletions

View File

@ -7,7 +7,7 @@ module Zero
class Controller
# initialize a new instance of the controller and call response on it
def self.call(env)
new(Zero::Request.new(env)).response
new(Zero::Request.create(env)).response
end
# set the renderer to use in the controller

View File

@ -11,4 +11,12 @@ describe Zero::Controller, '.call' do
it "returns an object with the first element being a status" do
subject[0].should be_kind_of(Numeric)
end
it "does not modify an existing request" do
r = Zero::Request.new(env)
r.params['foo'] = 'bar'
subject
r = Zero::Request.create(env)
expect(r.params['foo']).to eq('bar')
end
end