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
# 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
# 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"
# 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') %>
home_zoom: 3
second_user:
+ id: 2
email: test@example.com
active: 1
pass_crypt: <%= Digest::MD5.hexdigest('test') %>
home_zoom: 12
inactive_user:
+ id: 3
email: inactive@openstreetmap.org
active: 0
pass_crypt: <%= Digest::MD5::hexdigest('test2') %>
-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
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
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
# 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
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