]> git.openstreetmap.org Git - rails.git/blob - test/models/moderation_zone_test.rb
Merge remote-tracking branch 'upstream/pull/7060'
[rails.git] / test / models / moderation_zone_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class ModerationZoneTest < ActiveSupport::TestCase
6   def test_falls_within_any
7     create(:moderation_zone, :seville_cathedral)
8
9     # Dead center
10     assert ModerationZone.falls_within_any?(:lat => 37.385972, :lon => -5.993149)
11
12     # Inside, near the boundary
13     assert ModerationZone.falls_within_any?(:lat => 37.386658, :lon => -5.994024)
14
15     # Outside, near the boundary
16     assert_not ModerationZone.falls_within_any?(:lat => 37.386769, :lon => -5.994185)
17   end
18 end