Split li tags in link list helper

This way we generate the same HTML as we generate everywhere where we
manually generate lists of links. Having a blank space betwwen tags
results in a space being introduced when the elements are displayed
inline (or with `inline-block`).

So in places where we don't want that space between the elements we have
to use a flex layout.
This commit is contained in:
Javi Martín
2021-01-21 13:51:23 +01:00
parent 744b9d1ffd
commit d1ab8ac29b
5 changed files with 15 additions and 14 deletions

View File

@@ -13,7 +13,9 @@ describe LinkListHelper do
it "generates a list of links" do
list = helper.link_list(["Home", "/"], ["Info", "/info"], class: "menu")
expect(list).to eq '<ul class="menu"><li><a href="/">Home</a></li><li><a href="/info">Info</a></li></ul>'
expect(list).to eq '<ul class="menu">' +
'<li><a href="/">Home</a></li>' + "\n" +
'<li><a href="/info">Info</a></li></ul>'
expect(list).to be_html_safe
end