From 34c08d2ead9360e1d9577dbc491d221ab66a2151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 22 Nov 2013 14:53:31 -0200 Subject: [PATCH] Use a more generic assertion to make sure this tests will be useful. Since we are using assert_no_match, if we change the code before changing the tests, the tests will still pass and the assertion will become useless --- railties/test/generators/app_generator_test.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 6fccd1b399..843b4da970 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -197,12 +197,11 @@ class AppGeneratorTest < Rails::Generators::TestCase end assert_file "app/views/layouts/application.html.erb" do |contents| - assert_no_match(/stylesheet_link_tag\s+"application", media: "all", "data-turbolinks-track" => true/, contents) - assert_no_match(/javascript_include_tag\s+"application", "data-turbolinks-track" => true/, contents) + assert_no_match('data-turbolinks-track', contents) end assert_file "app/assets/javascripts/application.js" do |contents| - assert_no_match %r{^//= require turbolinks}, contents + assert_no_match 'turbolinks', contents end ensure template.close