require 'test_helper' module CssSplitter class ApplicationHelperTest < ActionView::TestCase test "should work w/out options" do output = split_stylesheet_link_tag("too_big_stylesheet") assert_equal "\n", output end test "should work with options and multiple stylesheets" do output = split_stylesheet_link_tag("too_big_stylesheet", "foo", media: "print") assert_equal "\n\n\n", output end test "should work with split_count option" do output = split_stylesheet_link_tag("too_big_stylesheet", split_count: 3) assert_equal "\n", output end class RailsEnvDefault < ActionView::TestCase setup do Rails.env = 'development' end teardown do Rails.env = 'test' end test "should default to false on splits" do output = split_stylesheet_link_tag("too_big_stylesheet") assert_equal "\n", output end test "should respect the debug=true option" do output = split_stylesheet_link_tag("too_big_stylesheet", debug: true) assert_equal "\n", output end test "should respect the debug=false option" do output = split_stylesheet_link_tag("too_big_stylesheet", debug: false) assert_equal "\n", output end end end end