aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/zero/controller.rb2
-rw-r--r--spec/unit/controller/call_spec.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/zero/controller.rb b/lib/zero/controller.rb
index 8469a09..cd9dbeb 100644
--- a/lib/zero/controller.rb
+++ b/lib/zero/controller.rb
@@ -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
diff --git a/spec/unit/controller/call_spec.rb b/spec/unit/controller/call_spec.rb
index af6f719..d62a3dc 100644
--- a/spec/unit/controller/call_spec.rb
+++ b/spec/unit/controller/call_spec.rb
@@ -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