aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-03 20:20:05 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-03 20:20:05 -0200
commit1468a11f9b927882c3df463f3705e170baca2079 (patch)
tree020e1f536957b89b6b28db5d75d93fa315ffc818 /railties/test
parent4591b0fc041454f4ba4a83629b9bbca2a851969c (diff)
parent6bd812605de2e2360606be3821a046778b874254 (diff)
downloadrails-1468a11f9b927882c3df463f3705e170baca2079.tar.gz
rails-1468a11f9b927882c3df463f3705e170baca2079.tar.bz2
rails-1468a11f9b927882c3df463f3705e170baca2079.zip
Merge pull request #13434 from tanraya/local_variables
Use local variables in _form.html.erb generated by scaffold. Conflicts: railties/CHANGELOG.md
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/scaffold_generator_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index 20b801f341..ad365f45d0 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -68,6 +68,17 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
end
assert_no_file "app/views/layouts/product_lines.html.erb"
+ # Views local variables
+ assert_file "app/views/product_lines/_form.html.erb" do |test|
+ assert_no_match(/@product_line/, test)
+ end
+
+ %w(edit new).each do |view|
+ assert_file "app/views/product_lines/#{view}.html.erb" do |test|
+ assert_match(/product_line: @product_line/, test)
+ end
+ end
+
# Helpers
assert_file "app/helpers/product_lines_helper.rb"