diff options
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/asset_debugging_test.rb | 8 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 18 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb index 707abe7191..1b99af22a4 100644 --- a/railties/test/application/asset_debugging_test.rb +++ b/railties/test/application/asset_debugging_test.rb @@ -45,8 +45,8 @@ module ApplicationTests # the debug_assets params isn't used if compile is off get '/posts?debug_assets=true' - assert_match /<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body - assert_no_match /<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body + assert_match(/<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body) + assert_no_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body) end test "assets aren't concatened when compile is true is on and debug_assets params is true" do @@ -58,8 +58,8 @@ module ApplicationTests class ::PostsController < ActionController::Base ; end get '/posts?debug_assets=true' - assert_match /<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body - assert_match /<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body + assert_match(/<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body) + assert_match(/<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body) end end end diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index a412b7d99b..1e0a26918b 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -77,8 +77,8 @@ module ApplicationTests manifest = "#{app_path}/public/assets/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] - assert_match /application-([0-z]+)\.css/, assets["application.css"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) + assert_match(/application-([0-z]+)\.css/, assets["application.css"]) end test "precompile creates a manifest file in a custom path with all the assets listed" do @@ -96,8 +96,8 @@ module ApplicationTests manifest = "#{app_path}/shared/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] - assert_match /application-([0-z]+)\.css/, assets["application.css"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) + assert_match(/application-([0-z]+)\.css/, assets["application.css"]) end @@ -113,7 +113,7 @@ module ApplicationTests manifest = "#{app_path}/public/x/manifest.yml" assets = YAML.load_file(manifest) - assert_match /application-([0-z]+)\.js/, assets["application.js"] + assert_match(/application-([0-z]+)\.js/, assets["application.js"]) end test "precompile does not append asset digests when config.assets.digest is false" do @@ -176,8 +176,8 @@ module ApplicationTests class ::PostsController < ActionController::Base ; end get '/posts' - assert_match /AssetNotPrecompiledError/, last_response.body - assert_match /app.js isn't precompiled/, last_response.body + assert_match(/AssetNotPrecompiledError/, last_response.body) + assert_match(/app.js isn't precompiled/, last_response.body) end test "precompile appends the md5 hash to files referenced with asset_path and run in the provided RAILS_ENV" do @@ -189,7 +189,7 @@ module ApplicationTests Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_ENV=test` } # end file = Dir["#{app_path}/public/assets/application-*.css"].first - assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) + assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file)) end test "precompile appends the md5 hash to files referenced with asset_path and run in production as default even using RAILS_GROUPS=assets" do @@ -201,7 +201,7 @@ module ApplicationTests Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_GROUPS=assets` } end file = Dir["#{app_path}/public/assets/application-*.css"].first - assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) + assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file)) end test "assets are cleaned up properly" do diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index cc65a674c9..0e03c3dc2d 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -79,9 +79,9 @@ module ApplicationTests silence_stderr do output = Dir.chdir(app_path){ `rake test` } - assert_match /Errors running test:units! #<ActiveRecord::AdapterNotSpecified/, output - assert_match /Errors running test:functionals! #<RuntimeError/, output - assert_match /Errors running test:integration! #<RuntimeError/, output + assert_match(/Errors running test:units! #<ActiveRecord::AdapterNotSpecified/, output) + assert_match(/Errors running test:functionals! #<RuntimeError/, output) + assert_match(/Errors running test:integration! #<RuntimeError/, output) end end |