3 class TracepointTest < ActiveSupport::TestCase
4 def test_timestamp_required
5 tracepoint = create(:tracepoint)
6 assert tracepoint.valid?
7 tracepoint.timestamp = nil
8 assert_not tracepoint.valid?
11 # Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05
12 def test_lat_lon_xml_format
13 tracepoint = build(:tracepoint, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)
15 assert_match(/lat="0.0000400"/, tracepoint.to_xml_node.to_s)
16 assert_match(/lon="0.0000800"/, tracepoint.to_xml_node.to_s)