Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions test/worldwide/region_yml_consistency_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,22 @@ class RegionYmlConsistencyTest < ActiveSupport::TestCase
end

test "example_city is available for each US state" do
assert_predicate Worldwide.region(code: "US").zones, :all? do |state|
!state.example_city&.empty?
Worldwide.region(code: "US").zones.each do |state|
# Skip territories that legitimately don't have cities
next if state.iso_code == "UM" # United States Minor Outlying Islands

assert_kind_of String, state.example_city, "example_city should be a String for #{state.iso_code}"
refute_predicate state.example_city, :empty?, "example_city should not be empty for #{state.iso_code}"
end
end

test "example_city_zip is available for each US state" do
assert_predicate Worldwide.region(code: "US").zones, :all? do |state|
!state.example_city_zip&.empty?
Worldwide.region(code: "US").zones.each do |state|
# Skip territories that legitimately don't have zip codes
next if state.iso_code == "UM" # United States Minor Outlying Islands

assert_kind_of String, state.example_city_zip, "example_city_zip should be a String for #{state.iso_code}"
refute_predicate state.example_city_zip, :empty?, "example_city_zip should not be empty for #{state.iso_code}"
end
end

Expand Down
Loading