- check_relations_for_element(:relations_for_node, "node",
- current_nodes(:node_used_by_relationship).id,
- [ :visible_relation, :used_relation ])
+ node = create(:node)
+ # should include relations with that node as a member
+ relation_with_node = create(:relation_member, :member => node).relation
+ # should ignore relations without that node as a member
+ _relation_without_node = create(:relation_member).relation
+ # should ignore relations with the node involved indirectly, via a way
+ way = create(:way_node, :node => node).way
+ _relation_with_way = create(:relation_member, :member => way).relation
+ # should ignore relations with the node involved indirectly, via a relation
+ second_relation = create(:relation_member, :member => node).relation
+ _super_relation = create(:relation_member, :member => second_relation).relation
+ # should combine multiple relation_member references into just one relation entry
+ create(:relation_member, :member => node, :relation => relation_with_node, :sequence_id => 2)
+ # should not include deleted relations
+ deleted_relation = create(:relation, :deleted)
+ create(:relation_member, :member => node, :relation => deleted_relation)
+
+ check_relations_for_element(:relations_for_node, "node",
+ node.id,
+ [relation_with_node, second_relation])