[openstreetmap/openstreetmap-website] Generate maplibre styles from `layers.yml` (PR #6772)

Pablo Brasero notifications at github.com
Mon Feb 9 15:17:51 UTC 2026


@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/3773810785 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260209/2b148268/attachment.htm>


More information about the rails-dev mailing list