@pablobm commented on this pull request.
> @@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require "test_helper"
+
+class MapLayersTest < ActiveSupport::TestCase
+ def test_full_definitions_returns_well_formed_layers_collection
+ layers = MapLayers.full_definitions("config/layers.yml")
+
+ assert_kind_of Array, layers, "Expected full_definitions to return an
array"
I would add a check that there are some layers present at all. Otherwise, if
there are no layers (count == 0) the `layers.each` loop below will appear to
pass when it's actually not testing anything.
```suggestion
assert_kind_of Array, layers, "Expected full_definitions to return an array"
assert_operator layers.count, :>, 0, "Expected some layers available"
```
The next test does test this when it does `layers.first["nameId"]`, but it's
indirect and I'd prefer it explicit.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6772#pullrequestreview-3773810785
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6772/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev