chore(rubocop): fix Rails/DurationArithmetic

This commit is contained in:
Colin Darie 2023-04-19 11:05:30 +02:00
parent 160178b8f8
commit 7aba5ccc3e
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
3 changed files with 5 additions and 5 deletions

View file

@ -108,7 +108,7 @@ module ProcedureStatsConcern
end
def last_considered_processed_at
(Time.zone.now - 1.month).end_of_month
(1.month.ago).end_of_month
end
def convert_seconds_in_days(seconds)

View file

@ -318,7 +318,7 @@ FactoryBot.define do
published
aasm_state { :close }
published_at { Time.zone.now - 1.second }
published_at { 1.second.ago }
closed_at { Time.zone.now }
end
@ -326,7 +326,7 @@ FactoryBot.define do
published
aasm_state { :depubliee }
published_at { Time.zone.now - 1.second }
published_at { 1.second.ago }
unpublished_at { Time.zone.now }
end

View file

@ -462,12 +462,12 @@ describe Procedure do
end
context "with token expired" do
let(:expiration_time) { (Time.zone.now - 1.day).to_i }
let(:expiration_time) { (1.day.ago).to_i }
it { is_expected.to be_truthy }
end
context "with token not expired" do
let(:expiration_time) { (Time.zone.now + 1.day).to_i }
let(:expiration_time) { (1.day.from_now).to_i }
it { is_expected.to be_falsey }
end
end