X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b13ac4ec21b83b51ebd5ccacc70f518bed03d9b2..fe81ac334cfef04751a959297dca24e472cb025f:/test/helpers/svg_helper_test.rb diff --git a/test/helpers/svg_helper_test.rb b/test/helpers/svg_helper_test.rb index 14c08539c..25a9e4568 100644 --- a/test/helpers/svg_helper_test.rb +++ b/test/helpers/svg_helper_test.rb @@ -52,20 +52,30 @@ class SvgHelperTest < ActionView::TestCase end def test_key_line - svg = key_svg_tag("width" => 80, "height" => 20, "line" => "blue") + svg = key_svg_tag("width" => 80, "height" => 15, "line" => "blue") expected = <<~HTML.gsub(/\n\s*/, "") - - + + HTML assert_dom_equal expected, svg end def test_key_line_width - svg = key_svg_tag("width" => 80, "height" => 20, "line" => "blue", "line-width" => 3) + svg = key_svg_tag("width" => 80, "height" => 15, "line" => "blue", "line-width" => 3) + expected = <<~HTML.gsub(/\n\s*/, "") + + + + HTML + assert_dom_equal expected, svg + end + + def test_key_line_with_integer_coords + svg = key_svg_tag("width" => 80, "height" => 20, "line" => "blue") expected = <<~HTML.gsub(/\n\s*/, "") - + HTML assert_dom_equal expected, svg @@ -75,10 +85,7 @@ class SvgHelperTest < ActionView::TestCase svg = key_svg_tag("width" => 80, "height" => 20, "casing" => "yellow") expected = <<~HTML.gsub(/\n\s*/, "") - - - - + HTML assert_dom_equal expected, svg @@ -88,10 +95,17 @@ class SvgHelperTest < ActionView::TestCase svg = key_svg_tag("width" => 80, "height" => 20, "casing" => "yellow", "casing-width" => 5) expected = <<~HTML.gsub(/\n\s*/, "") - - - - + + + HTML + assert_dom_equal expected, svg + end + + def test_key_casing_with_integer_coords + svg = key_svg_tag("width" => 80, "height" => 20, "casing" => "yellow", "casing-width" => 2) + expected = <<~HTML.gsub(/\n\s*/, "") + + HTML assert_dom_equal expected, svg