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
This commit is contained in:
Rafael Mendonça França 2013-11-22 14:53:31 -02:00
parent d5b71591df
commit 34c08d2ead
1 changed files with 2 additions and 3 deletions

View File

@ -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