[openstreetmap/openstreetmap-website] Redaction factory (#1492)
Andy Allan
notifications at github.com
Wed Mar 15 19:08:39 UTC 2017
gravitystorm commented on this pull request.
>
do_redact_node(nodes(:node_with_versions_v3),
- redactions(:example))
+ create(:redaction, :user => user))
For the tests that succeed, there was previously a correlation in that the fixture redaction was owned by `users(:moderator_user)`, which was the same user as the one used for logging in. So I thought it best to make those ones owned by the same moderator, and therefore even the failing ones like this should be owned by the same user, just in case.
But you're right, of course, this isn't actually required. I didn't check the controller code.
There's also a design issue here that I had in the back of my mind. For redactions it is currently possible for moderators to use a redaction created by someone else, and even edit it. But for user blocks, only the moderator that created one can edit it. So the "ownership" behaviour of user_blocks is quite different from redactions. There might be advantages in aligning the behaviour one way or the other in future.
If you'd prefer that I remove these (currently?) unnecessary ownerships in the tests, I'm happy to do that.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1492#discussion_r106257205
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20170315/918b839c/attachment.html>
More information about the rails-dev
mailing list