summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-03-25 01:32:23 +0000
committerGo MAEDA <maeda@farend.jp>2023-03-25 01:32:23 +0000
commit32d2b1c42f76c07e13bcf748b2071a29cf350606 (patch)
treea178f5208bdb7f5e9a43dca6cdbc5ac144b59459 /test
parentf27de353381a45427b6e38b87c973902de92484f (diff)
downloadredmine-32d2b1c42f76c07e13bcf748b2071a29cf350606.tar.gz
redmine-32d2b1c42f76c07e13bcf748b2071a29cf350606.zip
Fix RuboCop offense Style/InverseMethods: Use `present?` instead of inverting `blank?` (#37248).
git-svn-id: https://svn.redmine.org/redmine/trunk@22152 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/project_copy_test.rb2
-rw-r--r--test/unit/project_test.rb4
-rw-r--r--test/unit/user_test.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/project_copy_test.rb b/test/unit/project_copy_test.rb
index 917805e51..76cbec891 100644
--- a/test/unit/project_copy_test.rb
+++ b/test/unit/project_copy_test.rb
@@ -76,7 +76,7 @@ class ProjectCopyTest < ActiveSupport::TestCase
assert_equal @source_project.issues.size, @project.issues.size
@project.issues.each do |issue|
assert issue.valid?
- assert ! issue.assigned_to.blank?
+ assert issue.assigned_to.present?
assert_equal @project, issue.project
end
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 3e478e66e..43a3bf594 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -66,13 +66,13 @@ class ProjectTest < ActiveSupport::TestCase
end
with_settings :sequential_project_identifiers => '1' do
- assert !Project.new.identifier.blank?
+ assert Project.new.identifier.present?
assert Project.new(:identifier => '').identifier.blank?
end
with_settings :sequential_project_identifiers => '0' do
assert Project.new.identifier.blank?
- assert !Project.new(:identifier => 'test').blank?
+ assert Project.new(:identifier => 'test').present?
end
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index b6d9a34ef..577a7f972 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -1094,8 +1094,8 @@ class UserTest < ActiveSupport::TestCase
def test_random_password
u = User.new
u.random_password
- assert !u.password.blank?
- assert !u.password_confirmation.blank?
+ assert u.password.present?
+ assert u.password_confirmation.present?
end
def test_random_password_include_required_characters
@@ -1301,7 +1301,7 @@ class UserTest < ActiveSupport::TestCase
user.reload
# Salt added
- assert !user.salt.blank?
+ assert user.salt.present?
# Password still valid
assert user.check_password?("unsalted")
assert_equal user, User.try_to_login(user.login, "unsalted")