Browse Source

extract values to please Rubocop

rails6
Jérémy Lecour 1 year ago
committed by Jérémy Lecour
parent
commit
1e0adce074
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      test/models/check_test.rb

+ 8
- 2
test/models/check_test.rb View File

@ -117,22 +117,28 @@ class CheckTest < ActiveSupport::TestCase
test "set mode before saving" do
check = build(:check, domain: "domain.fr")
check.save!
assert check.auto?
check.domain = "domain.xyz"
check.save!
assert check.mode?
end
test "expiration in days (future)" do
check = create(:check, domain_expires_at: 1.week.from_now)
expected = 7
actual = check.domain_expires_in_days
assert_equal 7, check.domain_expires_in_days
assert_equal expected, actual
end
test "expiration in days (past)" do
check = create(:check, domain_expires_at: 1.week.ago)
expected = -7
actual = check.domain_expires_in_days
assert_equal -7, check.domain_expires_in_days
assert_equal expected, actual
end
end

Loading…
Cancel
Save