module BrowseHelper
- def element_single_current_link(type, object, url)
- link_to url, { :class => element_class(type, object), :title => element_title(object), :rel => (link_follow(object) if type == "node") } do
+ def element_single_current_link(type, object)
+ link_to object, { :class => element_class(type, object), :title => element_title(object), :rel => (link_follow(object) if type == "node") } do
element_strikethrough object do
printable_element_name object
end
<summary><%= t "browse.part_of_ways", :count => node.ways.uniq.count %></summary>
<ul class="list-unstyled">
<% node.ways.uniq.each do |way| %>
- <li><%= element_single_current_link "way", way, way_path(way) %></li>
+ <li><%= element_single_current_link "way", way %></li>
<% end %>
</ul>
</details>
<ul class="list-unstyled">
<% way.way_nodes.each do |wn| %>
<li>
- <%= element_single_current_link "node", wn.node, node_path(wn.node) %>
+ <%= element_single_current_link "node", wn.node %>
<% related_ways = wn.node.ways.reject { |w| w.id == wn.way_id } %>
<% if related_ways.size > 0 then %>
(<%= t ".also_part_of_html",
:count => related_ways.size,
- :related_ways => to_sentence(related_ways.map { |w| element_single_current_link "way", w, way_path(w) }) %>)
+ :related_ways => to_sentence(related_ways.map { |w| element_single_current_link "way", w }) %>)
<% end %>
</li>
<% end %>
assert_select ".secondary-actions a[href='#{old_node_path node, 2}']", :count => 1
end
+ def test_show_relation_member
+ member = create(:node)
+ relation = create(:relation)
+ create(:relation_member, :relation => relation, :member => member)
+ sidebar_browse_check :node_path, member.id, "browse/feature"
+ assert_select "a[href='#{relation_path relation}']", :count => 1
+ end
+
def test_show_deleted
node = create(:node, :visible => false)
sidebar_browse_check :node_path, node.id, "browse/feature"
assert_select ".secondary-actions a[href='#{old_relation_path relation, 1}']", :count => 1
assert_select ".secondary-actions a[href='#{old_relation_path relation, 2}']", :count => 1
end
+
+ def test_show_relation_member
+ member = create(:relation)
+ relation = create(:relation)
+ create(:relation_member, :relation => relation, :member => member)
+ sidebar_browse_check :relation_path, member.id, "browse/feature"
+ assert_select "a[href='#{relation_path relation}']", :count => 1
+ end
end
assert_select ".secondary-actions a[href='#{old_way_path way, 1}']", :count => 1
assert_select ".secondary-actions a[href='#{old_way_path way, 2}']", :count => 1
end
+
+ def test_show_relation_member
+ member = create(:way)
+ relation = create(:relation)
+ create(:relation_member, :relation => relation, :member => member)
+ sidebar_browse_check :way_path, member.id, "browse/feature"
+ assert_select "a[href='#{relation_path relation}']", :count => 1
+ end
end