Now just got one test to sort on the functional tests. All other tests are working and pass. Plenty more to write though.
This commit is contained in:
parent
ebb8e5524e
commit
3d5ee2675b
9 changed files with 27 additions and 12 deletions
3
test/fixtures/current_ways.yml
vendored
3
test/fixtures/current_ways.yml
vendored
|
@ -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
|
||||
|
||||
|
|
8
test/fixtures/messages.yml
vendored
8
test/fixtures/messages.yml
vendored
|
@ -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
|
||||
|
|
4
test/fixtures/user_preferences.yml
vendored
4
test/fixtures/user_preferences.yml
vendored
|
@ -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"
|
||||
|
|
3
test/fixtures/users.yml
vendored
3
test/fixtures/users.yml
vendored
|
@ -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') %>
|
||||
|
|
8
test/fixtures/way_nodes.yml
vendored
8
test/fixtures/way_nodes.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue