Wrap the ID in <bdi> tags for RTL locales
[rails.git] / test / helpers / browse_helper_test.rb
index 0abcd6df12f8c3a33ec7ac21bc2fbb0e7f106f48..38d8c2dffa8a7334c15996b0c9afcd3fb6be2aa6 100644 (file)
@@ -14,28 +14,28 @@ class BrowseHelperTest < ActionView::TestCase
 
   def test_printable_name
     assert_equal "17", printable_name(current_nodes(:redacted_node))
-    assert_equal "<bdi>Test Node</bdi> (18)", printable_name(current_nodes(:node_with_name))
-    assert_equal "<bdi>Test Node</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18</bdi>)", printable_name(current_nodes(:node_with_name))
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18</bdi>)", printable_name(nodes(:node_with_name_current_version))
     assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
-    assert_equal "<bdi>Test Node</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18, v2</bdi>)", printable_name(nodes(:node_with_name_current_version), true)
     assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
 
     I18n.locale = "ru"
 
     assert_equal "17", printable_name(current_nodes(:redacted_node))
-    assert_equal "<bdi>проверки узла</bdi> (18)", printable_name(current_nodes(:node_with_name))
-    assert_equal "<bdi>проверки узла</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
+    assert_equal "<bdi>проверки узла</bdi> (<bdi>18</bdi>)", printable_name(current_nodes(:node_with_name))
+    assert_equal "<bdi>проверки узла</bdi> (<bdi>18</bdi>)", printable_name(nodes(:node_with_name_current_version))
     assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
-    assert_equal "<bdi>проверки узла</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+    assert_equal "<bdi>проверки узла</bdi> (<bdi>18, v2</bdi>)", printable_name(nodes(:node_with_name_current_version), true)
     assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
 
     I18n.locale = "de"
 
     assert_equal "17", printable_name(current_nodes(:redacted_node))
-    assert_equal "<bdi>Test Node</bdi> (18)", printable_name(current_nodes(:node_with_name))
-    assert_equal "<bdi>Test Node</bdi> (18)", printable_name(nodes(:node_with_name_current_version))
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18</bdi>)", printable_name(current_nodes(:node_with_name))
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18</bdi>)", printable_name(nodes(:node_with_name_current_version))
     assert_equal "18", printable_name(nodes(:node_with_name_redacted_version))
-    assert_equal "<bdi>Test Node</bdi> (18, v2)", printable_name(nodes(:node_with_name_current_version), true)
+    assert_equal "<bdi>Test Node</bdi> (<bdi>18, v2</bdi>)", printable_name(nodes(:node_with_name_current_version), true)
     assert_equal "18, v1", printable_name(nodes(:node_with_name_redacted_version), true)
   end