aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2017-07-25 22:27:11 -0400
committerGeorge Claghorn <george@basecamp.com>2017-07-25 22:27:11 -0400
commit4fb518c28ce2b66ddb5483c07a2f185394ed80c4 (patch)
tree7bd925e03a399969201330e62e831ce66244003b /actionview/test
parent6f9b01c056cd2f3a4761baf78df207e1154f1b06 (diff)
downloadrails-4fb518c28ce2b66ddb5483c07a2f185394ed80c4.tar.gz
rails-4fb518c28ce2b66ddb5483c07a2f185394ed80c4.tar.bz2
rails-4fb518c28ce2b66ddb5483c07a2f185394ed80c4.zip
Fix testing helpers that use Action View's capturing helpers (e.g. content_for)
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/test_case_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/test_case_test.rb b/actionview/test/template/test_case_test.rb
index f2f64ffa71..05e5f21ce4 100644
--- a/actionview/test/template/test_case_test.rb
+++ b/actionview/test/template/test_case_test.rb
@@ -282,6 +282,14 @@ module ActionView
@customers = [DeveloperStruct.new("Eloy"), DeveloperStruct.new("Manfred")]
assert_match(/Hello: EloyHello: Manfred/, render(file: "test/list"))
end
+
+ test "is able to use helpers that depend on the view flow" do
+ assert_not content_for?(:foo)
+
+ content_for :foo, "bar"
+ assert content_for?(:foo)
+ assert_equal "bar", content_for(:foo)
+ end
end
class AssertionsTest < ActionView::TestCase