From 7a7fcced487de914c9bd2bfc9e4e51839413aa8e Mon Sep 17 00:00:00 2001 From: AEtherC0r3 Date: Tue, 6 Jun 2017 19:03:23 +0300 Subject: [PATCH] Replace .today with .current in program spec The cfp_open? method uses Date.current, so it should also be tested with Date.current and not Date.today Also, build was replaced with create to fix a false negative This is a partial fix for #1522 --- spec/models/program_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/program_spec.rb b/spec/models/program_spec.rb index ac720def..a2106791 100644 --- a/spec/models/program_spec.rb +++ b/spec/models/program_spec.rb @@ -141,7 +141,7 @@ describe Program do describe '#cfp_open?' do describe 'returns true' do it 'when there is an open Call for Papers for the conference' do - create(:cfp, start_date: Date.today - 2, end_date: Date.today, program_id: program.id) + create(:cfp, start_date: Date.current - 2, end_date: Date.current, program_id: program.id) expect(program.cfp_open?).to be true end end @@ -152,7 +152,7 @@ describe Program do end it 'when the Call for Papers period is over' do - build(:cfp, start_date: Date.today - 2, end_date: Date.today - 1, program_id: program.id) + create(:cfp, start_date: Date.current - 2, end_date: Date.current - 1, program_id: program.id) expect(program.cfp_open?).to be false end end