]> git.openstreetmap.org Git - rails.git/commitdiff
more testing of node tags
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 18 Aug 2008 13:55:21 +0000 (13:55 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 18 Aug 2008 13:55:21 +0000 (13:55 +0000)
config/database.yml
test/fixtures/current_node_tags.yml
test/unit/current_node_tag_test.rb
test/unit/node_test.rb

index fe47e11aa1bbae31073b8cfb8016b7005178d3dc..a80e11b70784068b19c360ea1c9218abb538b9f5 100644 (file)
 #   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
 development:
   adapter: mysql
-  database: openstreetmap
-  username: openstreetmap
-  password: openstreetmap
+  #database: openstreetmap
+  #username: openstreetmap
+  #password: openstreetmap
+  database: osm_test
+  username: osm_test
+  password: osm_test
   host: localhost
 
 # Warning: The database defined as 'test' will be erased and
index d9f5448a447da96ea945b749ba8426a69218359d..ce68a543923f795889f354756caf5daec96acbdd 100644 (file)
@@ -1,15 +1,15 @@
 t1:
-  id: visible_node.id
+  id: 1
   k: testvisible
   v: yes
 
 t2:
-  id: used_node_1.id
+  id: 2
   k: testused
   v: yes
 
 t3:
-  id: used_node_2.id
+  id: 3
   k: test
   v: yes
 
index 69b123b5a12ebfe9854de00b73826351b0325275..7fb1deff544a0b88499a5918bf58a84c521c86c7 100644 (file)
@@ -1,10 +1,20 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
 class CurrentNodeTagTest < Test::Unit::TestCase
-  fixtures :current_node_tags, :nodes
+  fixtures :current_node_tags, :current_nodes
+  set_fixture_class :current_nodes => :Node
+  set_fixture_class :current_node_tags => :NodeTag
   
   def test_tag_count
     assert_equal 3, NodeTag.count
+    node_tag_count(:visible_node, 1)
+    node_tag_count(:invisible_node, 1)
+    node_tag_count(:used_node_1, 1)
+  end
+  
+  def node_tag_count (node, count)
+    nod = current_nodes(node)
+    assert_equal count, nod.node_tags.count
   end
   
 end
index b5ef30298044cd99f18dc3ea5e4531197cc71aff..bb2b7dfa4fd6ab682b87be1002e669f9fd535326 100644 (file)
@@ -5,7 +5,7 @@ class NodeTest < Test::Unit::TestCase
   set_fixture_class :current_nodes => :Node
   set_fixture_class :nodes => :OldNode
   set_fixture_class :node_tags => :OldNodeTag
-  set_fixture_class :currenr_node_tags => :NodeTag
+  set_fixture_class :current_node_tags => :NodeTag
     
   def test_node_too_far_north
          invalid_node_test(:node_too_far_north)