]> git.openstreetmap.org Git - rails.git/blob - test/lib/country_test.rb
Merge remote-tracking branch 'upstream/pull/5150'
[rails.git] / test / lib / country_test.rb
1 require "test_helper"
2
3 class CountryTest < ActiveSupport::TestCase
4   def test_gb
5     gb = Country.find("GB")
6     assert_not_nil gb
7     assert_equal "GB", gb.code
8     assert_in_delta(-8.623555, gb.min_lon)
9     assert_in_delta(59.360249, gb.max_lat)
10     assert_in_delta(1.759, gb.max_lon)
11     assert_in_delta(49.906193, gb.min_lat)
12   end
13
14   def test_au
15     au = Country.find("AU")
16     assert_not_nil au
17     assert_equal "AU", au.code
18     assert_in_delta(112.911057, au.min_lon)
19     assert_in_delta(-10.062805, au.max_lat)
20     assert_in_delta(153.639252, au.max_lon)
21     assert_in_delta(-43.64397, au.min_lat)
22   end
23
24   def test_xx
25     xx = Country.find("XX")
26     assert_nil xx
27   end
28 end