[openstreetmap/openstreetmap-website] Don't assume order when testing links to changeset elements (PR #4571)
Anton Khorev
notifications at github.com
Wed Mar 13 00:04:39 UTC 2024
I noticed that one test fails sometimes:
```
Failure:
ChangesetsControllerTest#test_show_paginated_element_links [test/controllers/changesets_controller_test.rb:312]:
Expected exactly 1 element matching "a[href='/way/109']", found 0.
Expected: 1
Actual: 0
bin/rails test test/controllers/changesets_controller_test.rb:301
```
That's probably because I assumed that on the changeset page the elements will be shown in the same order as they were created. But actually they are not sorted, so sometimes the order may be different.
Here I remove the ordering assumption and check the next page for an element that was missing from the first page.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4571
-- Commit Summary --
* Don't assume order when testing links to changeset elements
-- File Changes --
M test/controllers/changesets_controller_test.rb (60)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4571.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4571.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4571
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4571 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240312/60261e52/attachment-0001.htm>
More information about the rails-dev
mailing list