diff options
author | Toshimaru <me@toshimaru.net> | 2016-12-09 03:08:17 +0900 |
---|---|---|
committer | Toshimaru <me@toshimaru.net> | 2016-12-09 05:21:02 +0900 |
commit | 7407d35c5417b6ef872663936a5880ede8ab711c (patch) | |
tree | 468d7f03864ed3dd7e85dbd398648b06e044f5cc /actionview/test | |
parent | a0aad0381a35aebab31f5a7318c2a1644f86bbea (diff) | |
download | rails-7407d35c5417b6ef872663936a5880ede8ab711c.tar.gz rails-7407d35c5417b6ef872663936a5880ede8ab711c.tar.bz2 rails-7407d35c5417b6ef872663936a5880ede8ab711c.zip |
Enable `block` variable in view
Remove `block` keyword from reserved method names
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/fixtures/test/test_template_with_block_variable.erb | 1 | ||||
-rw-r--r-- | actionview/test/template/compiled_templates_test.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/actionview/test/fixtures/test/test_template_with_block_variable.erb b/actionview/test/fixtures/test/test_template_with_block_variable.erb new file mode 100644 index 0000000000..2ee6a2bbdc --- /dev/null +++ b/actionview/test/fixtures/test/test_template_with_block_variable.erb @@ -0,0 +1 @@ +<%= block %>
\ No newline at end of file diff --git a/actionview/test/template/compiled_templates_test.rb b/actionview/test/template/compiled_templates_test.rb index 3ecac46d34..a24a245442 100644 --- a/actionview/test/template/compiled_templates_test.rb +++ b/actionview/test/template/compiled_templates_test.rb @@ -14,6 +14,10 @@ class CompiledTemplatesTest < ActiveSupport::TestCase render(file: "test/render_file_with_ruby_keyword_locals", locals: { class: "foo" }) end + def test_template_with_block_variable + assert_equal "foo", render(file: "test/test_template_with_block_variable", locals: { block: "foo" }) + end + def test_template_with_invalid_identifier_locals locals = { foo: "bar", |