[openstreetmap/openstreetmap-website] Note subscriptions db table (PR #5284)

Anton Khorev notifications at github.com
Sun Oct 27 23:08:20 UTC 2024


@AntonKhorev commented on this pull request.



> +        end
+      end
+      assert_response :success
+      js = ActiveSupport::JSON.decode(@response.body)
+      assert_not_nil js
+      assert_equal "Feature", js["type"]
+      assert_equal "Point", js["geometry"]["type"]
+      assert_equal [-1.0, -1.0], js["geometry"]["coordinates"]
+      assert_equal "open", js["properties"]["status"]
+      assert_equal 1, js["properties"]["comments"].count
+      assert_equal "opened", js["properties"]["comments"].last["action"]
+      assert_equal "This is a comment", js["properties"]["comments"].last["text"]
+      assert_equal user.display_name, js["properties"]["comments"].last["user"]
+
+      note = Note.last
+      subscription = NoteSubscription.last

> This ... is relying on nothing else having created notes

There is a check `assert_difference "Note.count", 1`

> (and all the other similar versions in other tests)

Other tests in this file or other tests elsewhere? You can find similar uses of `.last` from years ago.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5284#discussion_r1818205543
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5284/review/2397651922 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241027/2f9ddccf/attachment.htm>


More information about the rails-dev mailing list