[openstreetmap/openstreetmap-website] Use assert_not_predicate in tests that have assert_predicate (PR #4454)
Anton Khorev
notifications at github.com
Wed Jan 3 13:12:21 UTC 2024
You have a test that looks like this:
https://github.com/openstreetmap/openstreetmap-website/blob/04c697b468057d1a3604694e7ead9d2c6efd1dfa/test/models/note_test.rb#L40-L42
Then Rubocop starts complaining that you don't use `assert_predicate` and you change the test:
https://github.com/openstreetmap/openstreetmap-website/blob/6892ccd0155b431cc567b4744b1e2759df3e8c68/test/models/note_test.rb#L40-L42
Yet you keep negative assertions as `assert_not` and don't change then to `assert_not_predicate`. Are there any good reasons for that other than Rubocop no complaining?
```ruby
assert_not_predicate create(:note, :status => "hidden"), :visible?
```
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4454
-- Commit Summary --
* Use assert_not_predicate in tests that have assert_predicate
-- File Changes --
M test/lib/bounding_box_test.rb (2)
M test/models/acl_test.rb (2)
M test/models/changeset_comment_test.rb (12)
M test/models/changeset_tag_test.rb (8)
M test/models/client_application_test.rb (6)
M test/models/issue_test.rb (2)
M test/models/message_test.rb (4)
M test/models/node_tag_test.rb (8)
M test/models/note_comment_test.rb (4)
M test/models/oauth_token_test.rb (6)
M test/models/old_node_tag_test.rb (8)
M test/models/old_relation_tag_test.rb (8)
M test/models/old_way_tag_test.rb (8)
M test/models/redaction_test.rb (8)
M test/models/relation_member_test.rb (4)
M test/models/relation_tag_test.rb (8)
M test/models/report_test.rb (8)
M test/models/request_token_test.rb (2)
M test/models/trace_test.rb (22)
M test/models/tracepoint_test.rb (2)
M test/models/user_preference_test.rb (2)
M test/models/user_test.rb (30)
M test/models/way_tag_test.rb (8)
M test/system/report_diary_entry_test.rb (2)
M test/validators/characters_validator_test.rb (4)
M test/validators/whitespace_validator_test.rb (4)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4454.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4454.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4454
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4454 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240103/adacbaa1/attachment.htm>
More information about the rails-dev
mailing list