Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions test/css_splitter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ class CssSplitterTest < ActiveSupport::TestCase
part2 = "#test{background-color:green}" * CssSplitter::Splitter::MAX_SELECTORS_DEFAULT
part3 = "#test{background-color:blue}"

assert_equal "#{part1}#{part2}#{part3}\n", assets["erb_stylesheet"].to_s
assert_equal "#{part2}\n", assets["erb_stylesheet_split2"].to_s
assert_equal "#{part3}\n", assets["erb_stylesheet_split3"].to_s
assert_equal "#{part1}#{part2}#{part3}", assets["erb_stylesheet"].to_s.gsub(/\s/, '')
assert_equal "#{part2}", assets["erb_stylesheet_split2"].to_s.gsub(/\s/, '')
assert_equal "#{part3}", assets["erb_stylesheet_split3"].to_s.gsub(/\s/, '')
end

test "asset pipeline stylesheet splitting on stylesheet combined using requires" do
red = "#test{background-color:red}" * 100
green = "#test{background-color:green}" * CssSplitter::Splitter::MAX_SELECTORS_DEFAULT
blue = "#test{background-color:blue}"

assert_equal "#{red}#{green}#{blue}\n", assets["combined"].to_s
assert_equal "#{"#test{background-color:green}" * 100}#{blue}\n", assets["combined_split2"].to_s
assert_equal "#{red}#{green}#{blue}", assets["combined"].to_s.gsub(/\s/, '')
assert_equal "#{"#test{background-color:green}" * 100}#{blue}", assets["combined_split2"].to_s.gsub(/\s/, '')
end

private
Expand Down
3 changes: 2 additions & 1 deletion test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Application < Rails::Application

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]

config.sass.line_comments = false
config.assets.compress = true
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

Expand Down