- assert_equal 2, tags.size
- assert_equal "added in way version 3", tags["testing"]
- assert_equal "modified in way version 4", tags["testing two"]
+ assert_equal taglist.count, tags.count
+ taglist.each do |tag|
+ assert_equal tag.v, tags[tag.k]
+ end
+ end
+
+ def test_containing_relation_members
+ way = create(:way)
+ relation = create(:relation)
+ create(:relation_member, :relation => relation, :member => way)
+
+ crm = Way.find(way.id).containing_relation_members.order(:relation_id)
+ # assert_equal 1, crm.size
+ assert_equal relation.id, crm.first.relation_id
+ assert_equal "Way", crm.first.member_type
+ assert_equal way.id, crm.first.member_id
+ assert_equal relation.id, crm.first.relation.id
+ end
+
+ def test_containing_relations
+ way = create(:way)
+ relation = create(:relation)
+ create(:relation_member, :relation => relation, :member => way)
+
+ cr = Way.find(way.id).containing_relations.order(:id)
+ assert_equal 1, cr.size
+ assert_equal relation.id, cr.first.id