fix(spec): stop doing time comparisson, ensure it is not more nil

This commit is contained in:
Martin 2021-11-15 15:23:57 +01:00
parent 46fc956de3
commit f8783c9f00

View file

@ -102,11 +102,9 @@ describe CommentaireService do
it 'sets commentaire.body to deleted message' do
expect { subject }.to change { commentaire.reload.body }.from(an_instance_of(String)).to("Message supprimé")
end
it 'set deleted_at' do
now = Time.zone.now
Timecop.freeze(now) do
expect { subject }.to change { commentaire.reload.deleted_at }.from(nil).to(now)
end
it 'sets deleted_at' do
subject
expect(commentaire.reload.deleted_at).not_to be_nil
end
end
end