aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2016-07-26 15:46:18 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2016-07-26 15:47:44 -0300
commitf2978409e9b8aca7b9f54472a06ae631032f3243 (patch)
tree4eef7fda234d6904e7a36c8d0cfc1cf745da583e /actionpack
parentcbc61f513641ef3c311d671c322dc93f2d37d7fc (diff)
downloadrails-f2978409e9b8aca7b9f54472a06ae631032f3243.tar.gz
rails-f2978409e9b8aca7b9f54472a06ae631032f3243.tar.bz2
rails-f2978409e9b8aca7b9f54472a06ae631032f3243.zip
Return ActionDispatch.test_app when no app is set on IntegrationTest.app method
Fixes #25926
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/testing/integration.rb2
-rw-r--r--actionpack/test/controller/integration_test.rb19
2 files changed, 20 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb
index 4897f44268..c6577d3d15 100644
--- a/actionpack/lib/action_dispatch/testing/integration.rb
+++ b/actionpack/lib/action_dispatch/testing/integration.rb
@@ -717,7 +717,7 @@ module ActionDispatch
module ClassMethods
def app
- defined?(@@app) ? @@app : ActionDispatch.test_app
+ @@app || ActionDispatch.test_app
end
def app=(app)
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 3b89531e90..fc24857570 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -397,6 +397,25 @@ class IntegrationTestUsesCorrectClass < ActionDispatch::IntegrationTest
end
end
+class IntegrationTestDefaultApp < ActionDispatch::IntegrationTest
+ def setup
+ @app = self.class.app
+ self.class.app = nil
+
+ @test_app = ActionDispatch.test_app
+ ActionDispatch.test_app = 'fake_app'
+ end
+
+ def teardown
+ self.class.app = @app
+ ActionDispatch.test_app = @test_app
+ end
+
+ def test_class_app_returns_ad_test_app_by_default
+ assert_equal ActionDispatch.test_app, self.class.app
+ end
+end
+
class IntegrationProcessTest < ActionDispatch::IntegrationTest
class IntegrationController < ActionController::Base
def get