Fixing the resync that I had done wrong at the end of last week on the nodes. All unit tests now do work. More assertions added. Using a scaling factor as a constant, so that the nodes are stored in the db correctly. Using the same scaling factor in the georecord library, to make code more readable, and reduce errors. Removing duplicate code that is in the GeoRecord include library.
This commit is contained in:
parent
36203ebe26
commit
64a5e21f53
6 changed files with 217 additions and 105 deletions
32
test/fixtures/current_nodes.yml
vendored
32
test/fixtures/current_nodes.yml
vendored
|
@ -10,32 +10,32 @@ visible_node:
|
|||
|
||||
invisible_node:
|
||||
id: 2
|
||||
latitude: 2
|
||||
longitude: 2
|
||||
latitude: <%= 2*SCALE %>
|
||||
longitude: <%= 2*SCALE %>
|
||||
user_id: 1
|
||||
visible: 0
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
used_node_1:
|
||||
id: 3
|
||||
latitude: 3
|
||||
longitude: 3
|
||||
latitude: <%= 3*SCALE %>
|
||||
longitude: <%= 3*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
used_node_2:
|
||||
id: 4
|
||||
latitude: 4
|
||||
longitude: 4
|
||||
latitude: <%= 4*SCALE %>
|
||||
longitude: <%= 4*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
node_used_by_relationship:
|
||||
id: 5
|
||||
latitude: 5
|
||||
longitude: 5
|
||||
latitude: <%= 5*SCALE %>
|
||||
longitude: <%= 5*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
@ -49,29 +49,29 @@ node_too_far_north:
|
|||
|
||||
node_too_far_south:
|
||||
id: 7
|
||||
latitude: -90
|
||||
longitude: 7
|
||||
latitude: <%= -91*SCALE %>
|
||||
longitude: <%= 7*SCALE %>
|
||||
user_id: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
node_too_far_west:
|
||||
id: 8
|
||||
latitude: 8
|
||||
longitude: -181
|
||||
latitude: <%= 8*SCALE %>
|
||||
longitude: <%= -181*SCALE %>
|
||||
user_id: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
node_too_far_east:
|
||||
id: 9
|
||||
latitude: 9
|
||||
longitude: 180
|
||||
latitude: <%= 9*SCALE %>
|
||||
longitude: <%= 181*SCALE %>
|
||||
user_id: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
node_totally_wrong:
|
||||
id: 10
|
||||
latitude: 1000
|
||||
longitude: 1000
|
||||
latitude: <%= 1000*SCALE %>
|
||||
longitude: <%= 1000*SCALE %>
|
||||
user_id: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
|
|
20
test/fixtures/nodes.yml
vendored
20
test/fixtures/nodes.yml
vendored
|
@ -1,40 +1,40 @@
|
|||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
visible_node:
|
||||
id: 1
|
||||
latitude: 1
|
||||
longitude: 1
|
||||
latitude: <%= 1*SCALE %>
|
||||
longitude: <%= 1*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
invisible_node:
|
||||
id: 2
|
||||
latitude: 2
|
||||
longitude: 2
|
||||
latitude: <%= 2*SCALE %>
|
||||
longitude: <%= 2*SCALE %>
|
||||
user_id: 1
|
||||
visible: 0
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
used_node_1:
|
||||
id: 3
|
||||
latitude: 3
|
||||
longitude: 3
|
||||
latitude: <%= 3*SCALE %>
|
||||
longitude: <%= 3*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
used_node_2:
|
||||
id: 4
|
||||
latitude: 4
|
||||
longitude: 4
|
||||
latitude: <%= 4*SCALE %>
|
||||
longitude: <%= 4*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
||||
node_used_by_relationship:
|
||||
id: 5
|
||||
latitude: 5
|
||||
longitude: 5
|
||||
latitude: <%= 5*SCALE %>
|
||||
longitude: <%= 5*SCALE %>
|
||||
user_id: 1
|
||||
visible: 1
|
||||
timestamp: 2007-01-01 00:00:00
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue