aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/template_assertions_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/template_assertions_test.rb')
-rw-r--r--actionpack/test/dispatch/template_assertions_test.rb48
1 files changed, 44 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/template_assertions_test.rb b/actionpack/test/dispatch/template_assertions_test.rb
index b8bc8e22d4..3c393f937b 100644
--- a/actionpack/test/dispatch/template_assertions_test.rb
+++ b/actionpack/test/dispatch/template_assertions_test.rb
@@ -24,7 +24,7 @@ class AssertTemplateController < ActionController::Base
end
class AssertTemplateControllerTest < ActionDispatch::IntegrationTest
- def test_assert_template_reset_between_requests
+ def test_template_reset_between_requests
get '/assert_template/render_with_template'
assert_template 'test/hello_world'
@@ -32,7 +32,7 @@ class AssertTemplateControllerTest < ActionDispatch::IntegrationTest
assert_template nil
end
- def test_assert_partial_reset_between_requests
+ def test_partial_reset_between_requests
get '/assert_template/render_with_partial'
assert_template partial: 'test/_partial'
@@ -40,7 +40,7 @@ class AssertTemplateControllerTest < ActionDispatch::IntegrationTest
assert_template partial: nil
end
- def test_assert_layout_reset_between_requests
+ def test_layout_reset_between_requests
get '/assert_template/render_with_layout'
assert_template layout: 'layouts/standard'
@@ -48,11 +48,51 @@ class AssertTemplateControllerTest < ActionDispatch::IntegrationTest
assert_template layout: nil
end
- def test_assert_file_reset_between_requests
+ def test_file_reset_between_requests
get '/assert_template/render_with_file'
assert_template file: 'README.rdoc'
get '/assert_template/render_nothing'
assert_template file: nil
end
+
+ def test_template_reset_between_requests_when_opening_a_session
+ open_session do |session|
+ session.get '/assert_template/render_with_template'
+ session.assert_template 'test/hello_world'
+
+ session.get '/assert_template/render_nothing'
+ session.assert_template nil
+ end
+ end
+
+ def test_partial_reset_between_requests_when_opening_a_session
+ open_session do |session|
+ session.get '/assert_template/render_with_partial'
+ session.assert_template partial: 'test/_partial'
+
+ session.get '/assert_template/render_nothing'
+ session.assert_template partial: nil
+ end
+ end
+
+ def test_layout_reset_between_requests_when_opening_a_session
+ open_session do |session|
+ session.get '/assert_template/render_with_layout'
+ session.assert_template layout: 'layouts/standard'
+
+ session.get '/assert_template/render_nothing'
+ session.assert_template layout: nil
+ end
+ end
+
+ def test_file_reset_between_requests_when_opening_a_session
+ open_session do |session|
+ session.get '/assert_template/render_with_file'
+ session.assert_template file: 'README.rdoc'
+
+ session.get '/assert_template/render_nothing'
+ session.assert_template file: nil
+ end
+ end
end