diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 401a5d9099..e0c2ee60b4 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -316,7 +316,7 @@ L.OSM.Map = L.Map.extend({ if (object.type === "node") { return true; } else if (object.type === "relation") { - if (relationNodes[node.id]) return true; + return Boolean(relationNodes[node.id]); } else { return false; } diff --git a/test/system/browse_test.rb b/test/system/browse_test.rb new file mode 100644 index 0000000000..15dc1cb9b5 --- /dev/null +++ b/test/system/browse_test.rb @@ -0,0 +1,13 @@ +require "application_system_test_case" + +class BrowseTest < ApplicationSystemTestCase + test "relation member nodes should be visible on the map when viewing relations" do + relation = create(:relation) + node = create(:node) + create(:relation_member, :relation => relation, :member => node) + + visit relation_path(relation) + + assert_selector "#map .leaflet-overlay-pane path" + end +end