]> git.openstreetmap.org Git - rails.git/commitdiff
Refactored test a bit to make it nicer.
authorMatt Amos <zerebubuth@gmail.com>
Tue, 21 Oct 2008 11:40:06 +0000 (11:40 +0000)
committerMatt Amos <zerebubuth@gmail.com>
Tue, 21 Oct 2008 11:40:06 +0000 (11:40 +0000)
test/functional/relation_controller_test.rb

index 939a73df1e835d126b0a0350172f1e826de5a353..1c6439a966bac80fcfeecb5d63a32e872b83c11a 100644 (file)
@@ -49,15 +49,17 @@ class RelationControllerTest < Test::Unit::TestCase
     get :relations_for_node, :id => node_id
     assert_response :success
 
+    # the results we expect
+    expected_relations = [ :visible_relation, :used_relation ]
+
     # count one osm element
     assert_select "osm[version=#{API_VERSION}][generator=\"OpenStreetMap server\"]", 1
 
-    # we should have only two relations
-    assert_select "osm>relation", 2
+    # we should have only the expected number of relations
+    assert_select "osm>relation", expected_relations.size
 
     # and each of them should contain the node we originally searched for
-    [ :visible_relation, 
-      :used_relation ].each do |r|
+    expected_relations.each do |r|
       relation_id = current_relations(r).id
       assert_select "osm>relation#?", relation_id
       assert_select "osm>relation#?>member[type=\"node\"][ref=#{node_id}]", relation_id