diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-21 15:34:51 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-21 15:34:51 -0700 |
commit | c5fc159949f19708002ba801438ca5434192b074 (patch) | |
tree | 3290b1b128063b75722b46c37ade574009e23d97 /actionpack/test/dispatch/test_request_test.rb | |
parent | 03886d817307e091024ff3bd26844447abd8c408 (diff) | |
parent | 89ebd28d4ec899d840bddbef7711983a1ae2a162 (diff) | |
download | rails-c5fc159949f19708002ba801438ca5434192b074.tar.gz rails-c5fc159949f19708002ba801438ca5434192b074.tar.bz2 rails-c5fc159949f19708002ba801438ca5434192b074.zip |
Merge pull request #6429 from marcandre/fix_test_request
Fix bug when Rails.application is defined but is nil. See #881
Diffstat (limited to 'actionpack/test/dispatch/test_request_test.rb')
-rw-r--r-- | actionpack/test/dispatch/test_request_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index 4ee1d61146..6047631ba3 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -55,6 +55,13 @@ class TestRequestTest < ActiveSupport::TestCase assert_cookies({"user_name" => "david"}, req.cookie_jar) end + test "does not complain when Rails.application is nil" do + Rails.stubs(:application).returns(nil) + req = ActionDispatch::TestRequest.new + + assert_equal false, req.env.empty? + end + private def assert_cookies(expected, cookie_jar) assert_equal(expected, cookie_jar.instance_variable_get("@cookies")) |