]> git.openstreetmap.org Git - rails.git/commitdiff
Update for rubocop 0.54.0
authorTom Hughes <tom@compton.nu>
Thu, 17 May 2018 18:39:25 +0000 (19:39 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 17 May 2018 18:39:25 +0000 (19:39 +0100)
15 files changed:
.rubocop.yml
test/controllers/user_controller_test.rb
test/integration/user_terms_seen_test.rb
test/models/acl_test.rb
test/models/changeset_comment_test.rb
test/models/changeset_tag_test.rb
test/models/message_test.rb
test/models/node_tag_test.rb
test/models/old_node_tag_test.rb
test/models/old_relation_tag_test.rb
test/models/old_way_tag_test.rb
test/models/relation_tag_test.rb
test/models/tracepoint_test.rb
test/models/user_test.rb
test/models/way_tag_test.rb

index 6f721998dcdec8093d975fbb6d5fab1b0ca996e6..fc2b5cd85c884c5c40117df99ec75ae7b884d36b 100644 (file)
@@ -1,26 +1,5 @@
 inherit_from: .rubocop_todo.yml
 
-AllCops:
-  Include:
-    - '**/*.gemspec'
-    - '**/*.podspec'
-    - '**/*.jbuilder'
-    - '**/*.rake'
-    - '**/*.opal'
-    - '**/config.ru'
-    - '**/Gemfile'
-    - '**/Rakefile'
-    - '**/Capfile'
-    - '**/Guardfile'
-    - '**/Podfile'
-    - '**/Thorfile'
-    - '**/Vagrantfile'
-    - '**/Berksfile'
-    - '**/Cheffile'
-    - '**/Vagabondfile'
-    - '**/Fastfile'
-    - '**/*.builder'
-
 Rails:
   Enabled: true
 
index e149b83c7bfd79726e2f24ef3c2db1a045938efc..e8d452fc752a67418303e619c61db6ce25c95942 100644 (file)
@@ -567,7 +567,7 @@ class UserControllerTest < ActionController::TestCase
     stub_gravatar_request(user.new_email, 200)
     confirm_string = user.tokens.create.token
     # precondition gravatar should be turned off
-    assert !user.image_use_gravatar
+    assert_not user.image_use_gravatar
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
@@ -588,7 +588,7 @@ class UserControllerTest < ActionController::TestCase
     assert_redirected_to :action => :account, :display_name => user.display_name
     assert_match /Confirmed your change of email address/, flash[:notice]
     # gravatar use should now be disabled
-    assert !User.find(user.id).image_use_gravatar
+    assert_not User.find(user.id).image_use_gravatar
   end
 
   def test_terms_new_user
index 7ec7fa7307248e038f47bfa118c5dcd27cfd4297..811883f5fb8d17554c415ee3e507210ffec4b281 100644 (file)
@@ -44,7 +44,7 @@ class UserTermsSeenTest < ActionDispatch::IntegrationTest
 
       # should be carried through to a normal login with a message
       assert_response :success
-      assert !flash[:notice].nil?
+      assert_not flash[:notice].nil?
     end
   end
 
index 189f92677019bae19f1f7c557563b64f243ae668..d3d8f26feeb45b9dcb4617ceaa791239ce42d4b2 100644 (file)
@@ -5,17 +5,17 @@ class AclTest < ActiveSupport::TestCase
     acl = create(:acl)
     assert acl.valid?
     acl.k = nil
-    assert !acl.valid?
+    assert_not acl.valid?
   end
 
   def test_no_account_creation_by_subnet
-    assert !Acl.no_account_creation("192.168.1.1")
+    assert_not Acl.no_account_creation("192.168.1.1")
     create(:acl, :address => "192.168.0.0/16", :k => "no_account_creation")
     assert Acl.no_account_creation("192.168.1.1")
   end
 
   def test_no_account_creation_by_domain
-    assert !Acl.no_account_creation("192.168.1.1", "example.com")
+    assert_not Acl.no_account_creation("192.168.1.1", "example.com")
     create(:acl, :domain => "example.com", :k => "no_account_creation")
     assert Acl.no_account_creation("192.168.1.1", "example.com")
   end
index 8e8d0cd70b7646378b0bf3b37e54c172058264fc..58fdb9e75d6557a15652972396ec09eadba2f0b2 100644 (file)
@@ -6,27 +6,27 @@ class ChangesetCommentTest < ActiveSupport::TestCase
     comment = create(:changeset_comment)
 
     comment.author = nil
-    assert !comment.valid?
+    assert_not comment.valid?
 
     comment.author_id = 999111
-    assert !comment.valid?
+    assert_not comment.valid?
   end
 
   def test_does_not_accept_invalid_changeset
     comment = create(:changeset_comment)
 
     comment.changeset = nil
-    assert !comment.valid?
+    assert_not comment.valid?
 
     comment.changeset_id = 999111
-    assert !comment.valid?
+    assert_not comment.valid?
   end
 
   def test_does_not_accept_empty_visible
     comment = create(:changeset_comment)
 
     comment.visible = nil
-    assert !comment.valid?
+    assert_not comment.valid?
   end
 
   def test_comments_of_changeset_count
index 030614a1eeebe3e4e63e4e004b2524f5e6666811..2788d6f2d01c3884d8d382c991207d42ff5341c4 100644 (file)
@@ -62,7 +62,7 @@ class ChangesetTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index 285222f1e576217098f2861854015a87635f5ced..48319843b9f91b2781c43fbf38e7c9fe2c039d8c 100644 (file)
@@ -5,11 +5,11 @@ class MessageTest < ActiveSupport::TestCase
 
   def test_check_empty_message_fails
     message = Message.new
-    assert !message.valid?
+    assert_not message.valid?
     assert message.errors[:title].any?
     assert message.errors[:body].any?
     assert message.errors[:sent_on].any?
-    assert !message.message_read
+    assert_not message.message_read
   end
 
   def test_validating_msgs
@@ -23,7 +23,7 @@ class MessageTest < ActiveSupport::TestCase
     message = create(:message, :unread)
     message.sender = nil
     message.recipient = nil
-    assert !message.valid?
+    assert_not message.valid?
 
     assert_raise(ActiveRecord::RecordNotFound) { User.find(0) }
     message.from_user_id = 0
index 29eda2bffbd61a6217cd6854a128dca147d90573..57a5f0d43457d5db7bb7a3ab30e18a27f4a7e9d1 100644 (file)
@@ -44,7 +44,7 @@ class NodeTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index 3f0867a8772cd9813b8c84a07b193a2da1aff91b..33871657eda4052e73bbff804e6cf8d52a95b055 100644 (file)
@@ -20,7 +20,7 @@ class OldNodeTagTest < ActiveSupport::TestCase
   def test_length_key_invalid
     tag = create(:old_node_tag)
     tag.k = "k" * 256
-    assert !tag.valid?
+    assert_not tag.valid?
     assert tag.errors[:k].any?
   end
 
@@ -45,7 +45,7 @@ class OldNodeTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index 58c70cc9c5fcba90aefe8b3316843a13c45452a0..d9dae24732174e955e1f20d1760667ebbe40bb80 100644 (file)
@@ -45,7 +45,7 @@ class OldRelationTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index 057bdf4f0dca4650a9f71d4be10081aa477c3029..b2b6934249fe74095780f89f3e9078c960d8cd88 100644 (file)
@@ -45,7 +45,7 @@ class OldWayTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index 3b4d2cdfcbcd5e0fc400a7ff74c745ae56c03db5..cf9b24ded95f1361af86799709548aef09d84bcb 100644 (file)
@@ -44,7 +44,7 @@ class RelationTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end
index ae258f43a09b4d9a2b29c1abb44567ded53286b1..670db5bceecdd6acc1d754f870b3ef0179bb17b9 100644 (file)
@@ -5,7 +5,7 @@ class TracepointTest < ActiveSupport::TestCase
     tracepoint = create(:tracepoint)
     assert tracepoint.valid?
     tracepoint.timestamp = nil
-    assert !tracepoint.valid?
+    assert_not tracepoint.valid?
   end
 
   # Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05
index 8af701ca03171a02f00fddd4e023f5a22e94a5a0..168b9c3fa32672510da6eeb021413b2b6136b96f 100644 (file)
@@ -5,7 +5,7 @@ class UserTest < ActiveSupport::TestCase
 
   def test_invalid_with_empty_attributes
     user = User.new
-    assert !user.valid?
+    assert_not user.valid?
     assert user.errors[:email].any?
     assert user.errors[:pass_crypt].any?
     assert user.errors[:display_name].any?
@@ -25,7 +25,7 @@ class UserTest < ActiveSupport::TestCase
       :data_public => 1,
       :description => "desc"
     )
-    assert !new_user.save
+    assert_not new_user.save
     assert new_user.errors[:email].include?("has already been taken")
   end
 
@@ -39,7 +39,7 @@ class UserTest < ActiveSupport::TestCase
       :data_public => 1,
       :description => "desc"
     )
-    assert !new_user.save
+    assert_not new_user.save
     assert new_user.errors[:display_name].include?("has already been taken")
   end
 
@@ -69,12 +69,12 @@ class UserTest < ActiveSupport::TestCase
     user.display_name = "12"
     assert !user.valid?, "should not allow 2 char name"
     user.display_name = ""
-    assert !user.valid?
+    assert_not user.valid?
     user.display_name = nil
     # Don't understand why it isn't allowing a nil value,
     # when the validates statements specifically allow it
     # It appears the database does not allow null values
-    assert !user.valid?
+    assert_not user.valid?
   end
 
   def test_display_name_valid
@@ -110,11 +110,11 @@ class UserTest < ActiveSupport::TestCase
     create(:friend, :befriender => alice, :befriendee => bob)
 
     assert alice.is_friends_with?(bob)
-    assert !alice.is_friends_with?(charlie)
-    assert !bob.is_friends_with?(alice)
-    assert !bob.is_friends_with?(charlie)
-    assert !charlie.is_friends_with?(bob)
-    assert !charlie.is_friends_with?(alice)
+    assert_not alice.is_friends_with?(charlie)
+    assert_not bob.is_friends_with?(alice)
+    assert_not bob.is_friends_with?(charlie)
+    assert_not charlie.is_friends_with?(bob)
+    assert_not charlie.is_friends_with?(alice)
   end
 
   def test_users_nearby
index cde5bd4158d283ddee959c2024133a6fbf01c221..a3699cac4e1d311d45ea48f1cb586bb57f24a122 100644 (file)
@@ -44,7 +44,7 @@ class WayTagTest < ActiveSupport::TestCase
     tag.k = existing.k
     tag.v = existing.v
     assert tag.new_record?
-    assert !tag.valid?
+    assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert tag.new_record?
   end