21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-27 06:20:50 +02:00

extract values to please Rubocop

This commit is contained in:
Jérémy Lecour 2019-08-20 13:36:05 +02:00 committed by Jérémy Lecour
parent 81cf8b0f94
commit 1e0adce074

View file

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