提交 217e5f6e 编写于 作者: C Carlos Antonio da Silva

Improve the matches on the scaffold generator tests

Related to #13434.
上级 1468a11f
......@@ -63,20 +63,19 @@ def test_scaffold_on_invoke
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册