diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2016-07-26 22:02:38 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2016-07-26 22:04:56 -0300 |
commit | 1a2f1c48bdeda5df88e8031fe51943527ebc381e (patch) | |
tree | d79de419d72dcfb5108f732c62b2dad3c8e965d3 /railties/test/application | |
parent | d980abdb23f70409dfec90306cbf5ce9d9df17d7 (diff) | |
download | rails-1a2f1c48bdeda5df88e8031fe51943527ebc381e.tar.gz rails-1a2f1c48bdeda5df88e8031fe51943527ebc381e.tar.bz2 rails-1a2f1c48bdeda5df88e8031fe51943527ebc381e.zip |
There are some cases where @@app is not defined
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/integration_test_case_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/application/integration_test_case_test.rb b/railties/test/application/integration_test_case_test.rb index 52df5a2e5a..68e2de80c4 100644 --- a/railties/test/application/integration_test_case_test.rb +++ b/railties/test/application/integration_test_case_test.rb @@ -42,4 +42,32 @@ module ApplicationTests assert_match(/0 failures, 0 errors/, output) end end + + class IntegrationTestDefaultApp < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + setup do + build_app + end + + teardown do + teardown_app + end + + test "app method of integration tests returns test_app by default" do + app_file 'test/integration/default_app_test.rb', <<-RUBY + require 'test_helper' + + class DefaultAppIntegrationTest < ActionDispatch::IntegrationTest + def test_app_returns_action_dispatch_test_app_by_default + assert_equal ActionDispatch.test_app, app + end + end + RUBY + + output = Dir.chdir(app_path) { `bin/rails test 2>&1` } + assert_equal 0, $?.to_i, output + assert_match(/0 failures, 0 errors/, output) + end + end end |