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
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
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
# 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
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
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
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
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
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
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
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
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
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
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
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
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
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?
: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
: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
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
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
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