From 224252fd838abfd7b1ec004080776f15a59d29f9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 16 Aug 2016 19:27:40 +0100 Subject: [PATCH] Add test for formatting of multi-value wikidata links --- test/helpers/browse_helper_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/helpers/browse_helper_test.rb b/test/helpers/browse_helper_test.rb index 130bf8590..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 -- 2.43.2