diff --git a/src/main/java/no/ndla/taxonomy/util/PrettyUrlUtil.java b/src/main/java/no/ndla/taxonomy/util/PrettyUrlUtil.java index 2fa8fb2a..102478d2 100644 --- a/src/main/java/no/ndla/taxonomy/util/PrettyUrlUtil.java +++ b/src/main/java/no/ndla/taxonomy/util/PrettyUrlUtil.java @@ -33,7 +33,7 @@ public static Optional createPrettyUrl( rootName.ifPresent(rn -> { if (!rn.equals(name)) { buildUrlFragment(builder, cleanString(rootName.get())); - builder.append("_"); + builder.append("/"); } }); buildUrlFragment(builder, cleanString(name)); diff --git a/src/test/java/no/ndla/taxonomy/util/PrettyUrlUtilTest.java b/src/test/java/no/ndla/taxonomy/util/PrettyUrlUtilTest.java index 924736a7..8ebceb6e 100644 --- a/src/test/java/no/ndla/taxonomy/util/PrettyUrlUtilTest.java +++ b/src/test/java/no/ndla/taxonomy/util/PrettyUrlUtilTest.java @@ -26,7 +26,7 @@ void test_create_pretty_url() { @Test void test_create_pretty_url_with_root() { assertEquals( - "/e/the-root-title_this-is-a-title/hash", + "/e/the-root-title/this-is-a-title/hash", PrettyUrlUtil.createPrettyUrl(Optional.of("The root title"), "This is a title", "hash", NodeType.TOPIC) .get()); } @@ -60,7 +60,7 @@ void test_create_pretty_url_with_norwegian_chars() { Optional.empty(), "Når kommer høsten tror du ærlig talt?", "hash", NodeType.TOPIC) .get()); assertEquals( - "/e/utgatt-historie_a-hoppe-etter-wirkola/hash", + "/e/utgatt-historie/a-hoppe-etter-wirkola/hash", PrettyUrlUtil.createPrettyUrl( Optional.of("Utgått historie"), "Å hoppe etter wirkola", "hash", NodeType.TOPIC) .get());