X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/10cde3bb926bbbb5e90de0aceb0dd872b20a6089..7725cd59b41a622a634a447d33fbda738a472748:/test/helpers/browse_helper_test.rb diff --git a/test/helpers/browse_helper_test.rb b/test/helpers/browse_helper_test.rb index 19b290516..798c69b43 100644 --- a/test/helpers/browse_helper_test.rb +++ b/test/helpers/browse_helper_test.rb @@ -100,6 +100,9 @@ class BrowseHelperTest < ActionView::TestCase html = format_value("wikidata", "Q42") assert_dom_equal "Q42", html + + html = format_value("operator:wikidata", "Q12;Q98") + assert_dom_equal "Q12;Q98", html end def test_icon_tags @@ -149,6 +152,7 @@ class BrowseHelperTest < ActionView::TestCase def test_wikidata_links ### Non-prefixed wikidata-tag (only one value allowed) + # Non-wikidata tag links = wikidata_links("foo", "Test") assert_nil links @@ -193,8 +197,7 @@ class BrowseHelperTest < ActionView::TestCase assert_equal "//www.wikidata.org/wiki/Q24?uselang=en", links[0][:url] assert_equal "Q24", links[0][:title] - # another allowed key, this time with multiple values and I18n - + # Another allowed key, this time with multiple values and I18n I18n.locale = "dsb" links = wikidata_links("brand:wikidata", "Q936;Q2013;Q1568346") assert_equal 3, links.length @@ -206,7 +209,7 @@ class BrowseHelperTest < ActionView::TestCase assert_equal "Q1568346", links[2][:title] I18n.locale = "en" - # and now with whitespaces… + # and now with whitespaces... links = wikidata_links("subject:wikidata", "Q6542248 ;\tQ180\n ;\rQ364\t\n\r ;\nQ4006") assert_equal 4, links.length assert_equal "//www.wikidata.org/wiki/Q6542248?uselang=en", links[0][:url]