diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-01-03 20:28:32 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-01-03 20:30:31 -0200 |
commit | 217e5f6e4a9d1764bc511ca095bbb15a63bb3b19 (patch) | |
tree | 9a7ca223020f57427b06397240544b8c53873c80 | |
parent | 1468a11f9b927882c3df463f3705e170baca2079 (diff) | |
download | rails-217e5f6e4a9d1764bc511ca095bbb15a63bb3b19.tar.gz rails-217e5f6e4a9d1764bc511ca095bbb15a63bb3b19.tar.bz2 rails-217e5f6e4a9d1764bc511ca095bbb15a63bb3b19.zip |
Improve the matches on the scaffold generator tests
Related to #13434.
-rw-r--r-- | railties/test/generators/scaffold_generator_test.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index ad365f45d0..3b545328b5 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -63,20 +63,19 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase end # Views - %w(index edit new show _form).each do |view| - assert_file "app/views/product_lines/#{view}.html.erb" - 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) + %w(index show).each do |view| + assert_file "app/views/product_lines/#{view}.html.erb" 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 + assert_file "app/views/product_lines/#{view}.html.erb", /render 'form', product_line: @product_line/ + end + + assert_file "app/views/product_lines/_form.html.erb" do |test| + assert_match 'product_line', test + assert_no_match '@product_line', test end # Helpers |