[openstreetmap/openstreetmap-website] Add :closed trait to note factory (PR #4459)

Anton Khorev notifications at github.com
Fri Jan 5 10:22:38 UTC 2024


Currently you create a closed note in tests like this:

```ruby
create(:note, :status => "closed", :closed_at => Time.now.utc)
```

You have to remember to set `:closed_at`. There's code that assumes that closed notes have this time set. If omitted, it's going to be unset.

Here I add the `:closed` trait to the note factory that will set `:closed_at` and also add a closing comment.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4459

-- Commit Summary --

  * Add :closed trait to note factory
  * Add closed_by attribute to :closed note factory trait

-- File Changes --

    M test/controllers/api/notes_controller_test.rb (14)
    M test/controllers/notes_controller_test.rb (4)
    M test/factories/notes.rb (13)
    M test/models/note_test.rb (12)
    M test/system/note_comments_test.rb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4459.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4459.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/4459 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240105/e0781d8e/attachment.htm>


More information about the rails-dev mailing list