Don't link to self from element version pages

This commit is contained in:
Anton Khorev 2024-01-17 03:34:42 +03:00
parent 81c11988f5
commit 3a5c729865
4 changed files with 10 additions and 1 deletions

View file

@ -1,6 +1,6 @@
<h4>
<%= t "browse.version" %>
#<%= link_to common_details.version, :controller => "old_#{@type.pluralize}", :action => :show, :version => common_details.version %>
#<%= link_to_unless_current common_details.version, :controller => "old_#{@type.pluralize}", :action => :show, :version => common_details.version %>
</h4>
<p class="fst-italic">

View file

@ -14,6 +14,9 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_template "old_nodes/show"
assert_template :layout => "map"
assert_select "h4", /^Version/ do
assert_select "a[href='#{old_node_path node, 1}']", :count => 0
end
end
def test_not_found

View file

@ -14,6 +14,9 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_template "old_relations/show"
assert_template :layout => "map"
assert_select "h4", /^Version/ do
assert_select "a[href='#{old_relation_path relation, 1}']", :count => 0
end
end
def test_visible_with_members

View file

@ -14,6 +14,9 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_template "old_ways/show"
assert_template :layout => "map"
assert_select "h4", /^Version/ do
assert_select "a[href='#{old_way_path way, 1}']", :count => 0
end
end
def test_visible_with_shared_nodes