diff options
author | schneems <richard.schneeman@gmail.com> | 2016-08-30 15:04:23 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2016-08-30 15:04:23 -0500 |
commit | 70dd041f354dfc71b7e516d5ba5725c769ef06d9 (patch) | |
tree | a5a74a7db4121889e572e2e6643c367541110f1e | |
parent | ab5857a53a50cf9de0a8b869c5f43b1acdb90aa5 (diff) | |
download | rails-70dd041f354dfc71b7e516d5ba5725c769ef06d9.tar.gz rails-70dd041f354dfc71b7e516d5ba5725c769ef06d9.tar.bz2 rails-70dd041f354dfc71b7e516d5ba5725c769ef06d9.zip |
Fix style
-rw-r--r-- | actionview/lib/action_view/helpers/asset_url_helper.rb | 10 | ||||
-rw-r--r-- | railties/test/application/asset_debugging_test.rb | 52 |
2 files changed, 31 insertions, 31 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb index d1f85d3319..0967245855 100644 --- a/actionview/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb @@ -130,7 +130,7 @@ module ActionView # All options passed to +asset_path+ will be passed to +compute_asset_path+ # which is implemented by sprockets-rails. # - # asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js" + # asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js" # # === Without the asset pipeline (<tt>skip_pipeline: true</tt>) # @@ -138,10 +138,10 @@ module ActionView # checking is done to verify the source passed into +asset_path+ is valid # and that the file exists on disk. # - # asset_path("application.js", skip_pipeline: true) # => "application.js" - # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png" - # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js" - # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css" + # asset_path("application.js", skip_pipeline: true) # => "application.js" + # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png" + # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js" + # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css" # # === Options applying to all assets # diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb index 06d170fa4a..3e17a1efa5 100644 --- a/railties/test/application/asset_debugging_test.rb +++ b/railties/test/application/asset_debugging_test.rb @@ -72,23 +72,23 @@ module ApplicationTests test "public path and tag methods are not over-written by the asset pipeline" do contents = "doesnotexist" cases = { - asset_path: %r{/#{ contents }}, - image_path: %r{/images/#{ contents }}, - video_path: %r{/videos/#{ contents }}, - audio_path: %r{/audios/#{ contents }}, - font_path: %r{/fonts/#{ contents }}, - javascript_path: %r{/javascripts/#{ contents }}, - stylesheet_path: %r{/stylesheets/#{ contents }}, - image_tag: %r{<img src="/images/#{ contents }"}, - favicon_link_tag: %r{<link rel="shortcut icon" type="image/x-icon" href="/images/#{ contents }" />}, - stylesheet_link_tag: %r{<link rel="stylesheet" media="screen" href="/stylesheets/#{ contents }.css" />}, - javascript_include_tag: %r{<script src="/javascripts/#{ contents }.js">}, - audio_tag: %r{<audio src="/audios/#{ contents }"></audio>}, - video_tag: %r{<video src="/videos/#{ contents }"></video>} + asset_path: %r{/#{contents}}, + image_path: %r{/images/#{contents}}, + video_path: %r{/videos/#{contents}}, + audio_path: %r{/audios/#{contents}}, + font_path: %r{/fonts/#{contents}}, + javascript_path: %r{/javascripts/#{contents}}, + stylesheet_path: %r{/stylesheets/#{contents}}, + image_tag: %r{<img src="/images/#{contents}"}, + favicon_link_tag: %r{<link rel="shortcut icon" type="image/x-icon" href="/images/#{contents}" />}, + stylesheet_link_tag: %r{<link rel="stylesheet" media="screen" href="/stylesheets/#{contents}.css" />}, + javascript_include_tag: %r{<script src="/javascripts/#{contents}.js">}, + audio_tag: %r{<audio src="/audios/#{contents}"></audio>}, + video_tag: %r{<video src="/videos/#{contents}"></video>} } cases.each do |(view_method, tag_match)| - app_file "app/views/posts/index.html.erb", "<%= #{ view_method } '#{contents}', skip_pipeline: true %>" + app_file "app/views/posts/index.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %>" app "development" @@ -97,24 +97,24 @@ module ApplicationTests get "/posts?debug_assets=true" body = last_response.body - assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{ tag_match }, but did not: #{ body }") + assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{tag_match}, but did not: #{body}") end end test "public url methods are not over-written by the asset pipeline" do contents = "doesnotexist" cases = { - asset_url: %r{http://example.org/#{ contents }}, - image_url: %r{http://example.org/images/#{ contents }}, - video_url: %r{http://example.org/videos/#{ contents }}, - audio_url: %r{http://example.org/audios/#{ contents }}, - font_url: %r{http://example.org/fonts/#{ contents }}, - javascript_url: %r{http://example.org/javascripts/#{ contents }}, - stylesheet_url: %r{http://example.org/stylesheets/#{ contents }}, + asset_url: %r{http://example.org/#{contents}}, + image_url: %r{http://example.org/images/#{contents}}, + video_url: %r{http://example.org/videos/#{contents}}, + audio_url: %r{http://example.org/audios/#{contents}}, + font_url: %r{http://example.org/fonts/#{contents}}, + javascript_url: %r{http://example.org/javascripts/#{contents}}, + stylesheet_url: %r{http://example.org/stylesheets/#{contents}}, } cases.each do |(view_method, tag_match)| - app_file "app/views/posts/index.html.erb", "<%= #{ view_method } '#{contents}', skip_pipeline: true %>" + app_file "app/views/posts/index.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %>" app "development" @@ -123,7 +123,7 @@ module ApplicationTests get "/posts?debug_assets=true" body = last_response.body - assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{ tag_match }, but did not: #{ body }") + assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{tag_match}, but did not: #{body}") end end @@ -133,7 +133,7 @@ module ApplicationTests /application.js/ => { skip_pipeline: true }, } cases.each do |(tag_match, options_hash)| - app_file "app/views/posts/index.html.erb", "<%= asset_path('application.js', #{ options_hash }) %>" + app_file "app/views/posts/index.html.erb", "<%= asset_path('application.js', #{options_hash}) %>" app "development" @@ -142,7 +142,7 @@ module ApplicationTests get "/posts?debug_assets=true" body = last_response.body.strip - assert_match(tag_match, body, "Expected `asset_path` with `#{ options_hash}` to produce a match to #{ tag_match }, but did not: #{ body }") + assert_match(tag_match, body, "Expected `asset_path` with `#{options_hash}` to produce a match to #{tag_match}, but did not: #{body}") end end |