aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/readonly_test.rb
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-04-17 18:21:34 -0400
committerDaniel Colson <danieljamescolson@gmail.com>2018-04-19 08:11:33 -0400
commita1ac18671a90869ef81d02f2eafe8104e4eea34f (patch)
tree03109650a8d23c4284fafb90c077ab03185805e9 /activerecord/test/cases/readonly_test.rb
parent087e0ccb72e7a1491701dd1d1d49746f745d9d68 (diff)
downloadrails-a1ac18671a90869ef81d02f2eafe8104e4eea34f.tar.gz
rails-a1ac18671a90869ef81d02f2eafe8104e4eea34f.tar.bz2
rails-a1ac18671a90869ef81d02f2eafe8104e4eea34f.zip
Replace `assert !` with `assert_not`
This autocorrects the violations after adding a custom cop in 3305c78dcd.
Diffstat (limited to 'activerecord/test/cases/readonly_test.rb')
-rw-r--r--activerecord/test/cases/readonly_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/readonly_test.rb b/activerecord/test/cases/readonly_test.rb
index 383e43ed55..059fa76132 100644
--- a/activerecord/test/cases/readonly_test.rb
+++ b/activerecord/test/cases/readonly_test.rb
@@ -23,7 +23,7 @@ class ReadOnlyTest < ActiveRecord::TestCase
assert_nothing_raised do
dev.name = "Luscious forbidden fruit."
- assert !dev.save
+ assert_not dev.save
dev.name = "Forbidden."
end
@@ -38,8 +38,8 @@ class ReadOnlyTest < ActiveRecord::TestCase
end
def test_find_with_readonly_option
- Developer.all.each { |d| assert !d.readonly? }
- Developer.readonly(false).each { |d| assert !d.readonly? }
+ Developer.all.each { |d| assert_not d.readonly? }
+ Developer.readonly(false).each { |d| assert_not d.readonly? }
Developer.readonly(true).each { |d| assert d.readonly? }
Developer.readonly.each { |d| assert d.readonly? }
end
@@ -55,14 +55,14 @@ class ReadOnlyTest < ActiveRecord::TestCase
def test_has_many_find_readonly
post = Post.find(1)
assert_not_empty post.comments
- assert !post.comments.any?(&:readonly?)
- assert !post.comments.to_a.any?(&:readonly?)
+ assert_not post.comments.any?(&:readonly?)
+ assert_not post.comments.to_a.any?(&:readonly?)
assert post.comments.readonly(true).all?(&:readonly?)
end
def test_has_many_with_through_is_not_implicitly_marked_readonly
assert people = Post.find(1).people
- assert !people.any?(&:readonly?)
+ assert_not people.any?(&:readonly?)
end
def test_has_many_with_through_is_not_implicitly_marked_readonly_while_finding_by_id