]> git.openstreetmap.org Git - rails.git/blob - test/lib/country_test.rb
Refactor api controllers to inherit from a common ApiController
[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_equal(-8.623555, gb.min_lon)
9     assert_equal 59.360249, gb.max_lat
10     assert_equal 1.759, gb.max_lon
11     assert_equal 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_equal 112.911057, au.min_lon
19     assert_equal(-10.062805, au.max_lat)
20     assert_equal 153.639252, au.max_lon
21     assert_equal(-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