test/test_merging.rb in css_parser-1.1.4 vs test/test_merging.rb in css_parser-1.1.5
- old
+ new
@@ -83,6 +83,21 @@
def test_returning_early_with_only_one_params
rs = RuleSet.new(nil, 'font-weight: bold;')
merged = CssParser.merge(rs)
assert_equal rs.object_id, merged.object_id
end
+
+ def test_merging_important
+ rs1 = RuleSet.new(nil, 'color: black !important;')
+ rs2 = RuleSet.new(nil, 'color: red;')
+ merged = CssParser.merge(rs1, rs2)
+ assert_equal 'black !important;', merged['color']
+ end
+
+ def test_merging_shorthand_important
+ rs1 = RuleSet.new(nil, 'background: black none !important;')
+ rs2 = RuleSet.new(nil, 'background-color: red;')
+ merged = CssParser.merge(rs1, rs2)
+ assert_equal 'black !important;', merged['background-color']
+ end
+
end