Now just got one test to sort on the functional tests. All other tests are working...
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 22 Jul 2008 14:06:53 +0000 (14:06 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 22 Jul 2008 14:06:53 +0000 (14:06 +0000)
test/fixtures/current_ways.yml
test/fixtures/messages.yml
test/fixtures/user_preferences.yml
test/fixtures/users.yml
test/fixtures/way_nodes.yml
test/functional/api_controller_test.rb
test/functional/node_controller_test.rb
test/functional/old_way_controller_test.rb
test/test_helper.rb

index b129d7f45eb7d1a026f361bd0d3b0c5fafb7d22d..9b5b5ab8a0619d2aa1153103501ba1e0ab1495a7 100644 (file)
@@ -3,16 +3,19 @@ visible_way:
   user_id: 1
   timestamp: 2007-01-01 00:00:00
   visible: 1
+  version: 1
 
 invisible_way:
   id: 2
   user_id: 1
   timestamp: 2007-01-01 00:00:00
   visible: 0
+  version: 1
 
 used_way:
   id: 3
   user_id: 1
   timestamp: 2007-01-01 00:00:00
   visible: 1
+  version: 1
 
index feab6536ef91ea83ea57db374571630224fd8448..22fab186322bca351586e0297f3d89aa98b4b15a 100644 (file)
@@ -1,16 +1,16 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
-  sender: normal_user
+  from_user_id: 1
   title: test message 1
   body: some body text
   sent_on: "2008-05-01 12:34:56"
   message_read: false
-  recipient: second_user
+  to_user_id: 2
   
 two:
-  sender: second_user
+  from_user_id: 2
   title: test message 2
   body: some body test
   sent_on: "2008-05-02 12:45:23"
   message_read: true
-  recipient: normal_user
+  to_user_id: 1
index ab95c357db65ac601504e967e3c9f613bac4d6c6..59ebd0542bd9cdcf672414c30a1ec8d91c43497d 100644 (file)
@@ -1,11 +1,11 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 
 a:
-  user: normal_user
+  user_id: 1
   k: "key"
   v: "value"
 
 two:
-  user: normal_user
+  user_id: 1
   k: "some_key"
   v: "some_value"
index 5a788c25c90951b98c7a2950610680d860511c05..28e1aca3d0fd26a757cb39d01fab696fe89ab582 100644 (file)
@@ -1,5 +1,6 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 normal_user:
+  id: 1
   email: test@openstreetmap.org
   active: 1
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
@@ -12,6 +13,7 @@ normal_user:
   home_zoom: 3
   
 second_user:
+  id: 2
   email: test@example.com
   active: 1
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
@@ -24,6 +26,7 @@ second_user:
   home_zoom: 12
   
 inactive_user:
+  id: 3
   email: inactive@openstreetmap.org
   active: 0
   pass_crypt: <%= Digest::MD5::hexdigest('test2') %>
index caeac16b1d7b16a1bbc1f580432b6047785d718e..c12a248a0cea4ec75408745c43b8f355961db686 100644 (file)
@@ -1,9 +1,15 @@
-t1:
+t1a:
   id: 1
   node_id: 3
   sequence_id: 1
   version: 1
 
+t1b:
+  id: 1
+  node_id: 4
+  sequence_id: 2
+  version: 1
+  
 t2:
   id: 2
   node_id: 3
index 05cbe2af0ac5d8ab4a33816dfb30485e3dde1c72..4c4787ff76e0e0e05e0da2971ad983f0098bf944 100644 (file)
@@ -23,7 +23,7 @@ class ApiControllerTest < Test::Unit::TestCase
 
   def test_map
     node = current_nodes(:used_node_1)
-    bbox = "#{node.latitude-0.1},#{node.longitude-0.1},#{node.latitude+0.1},#{node.longitude+0.1}"
+    bbox = "#{node.lat-0.1},#{node.lon-0.1},#{node.lat+0.1},#{node.lon+0.1}"
     get :map, :bbox => bbox
     if $VERBOSE
         print @response.body
index a380eeb208313f08672104595eef0d188ec72e06..3f316d01224e9d63aae5a3823f89b9f58ff078f0 100644 (file)
@@ -57,7 +57,7 @@ class NodeControllerTest < Test::Unit::TestCase
     assert_response :unauthorized
 
     # now set auth
-    basic_authorization("test@openstreetmap.org", "test");  
+    basic_authorization(users(:normal_user).email, "test");  
 
     # this should work
     delete :delete, :id => current_nodes(:visible_node).id
index 374ea7dc2de42bbba429d9c2946d24b0d601ccf5..b4e3c5127721210ac025f856f2a28bd8c196f057 100644 (file)
@@ -17,11 +17,13 @@ class OldWayControllerTest < Test::Unit::TestCase
   # Test reading old ways.
   # -------------------------------------
 
-  def test_history
+  def test_history_visible
     # check that a visible way is returned properly
     get :history, :id => ways(:visible_way).id
     assert_response :success
-
+  end
+  
+  def test_history_invisible
     # check chat a non-existent way is not returned
     get :history, :id => 0
     assert_response :not_found
index e954a9495c2cb63a2dda534e7d7648a89e4fb921..22cc0e15c36bf880e219170652cd76e4bdb7a14b 100644 (file)
@@ -29,9 +29,10 @@ class Test::Unit::TestCase
   def self.api_fixtures
     fixtures :users
 
-    fixtures :current_nodes, :nodes
+    fixtures :current_nodes, :nodes, :current_node_tags
     set_fixture_class :current_nodes => :Node
     set_fixture_class :nodes => :OldNode
+    set_fixture_class :current_node_tags => :NodeTag
 
     fixtures :current_ways, :current_way_nodes, :current_way_tags
     set_fixture_class :current_ways => :Way