aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2012-05-21 15:24:18 -0400
committerSteve Klabnik <steve@steveklabnik.com>2012-08-28 21:06:58 -0700
commit728e925735d6532d1acd586f9dde30c499f91344 (patch)
tree9cb2cd77a04211048636455c136cbfb6e0c08e0a /actionpack/test/dispatch
parent58d35f62110d4280818d49f6a76b3bdaa1ee217a (diff)
downloadrails-728e925735d6532d1acd586f9dde30c499f91344.tar.gz
rails-728e925735d6532d1acd586f9dde30c499f91344.tar.bz2
rails-728e925735d6532d1acd586f9dde30c499f91344.zip
Fix bug when Rails.application is defined but is nil. See #881
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/test_request_test.rb7
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"))