Skip to content

Commit

Permalink
Merged in r2-2786-rspec-fails-leap-year (pull request #6692)
Browse files Browse the repository at this point in the history
R2-2786 Rspec fails due to leap year

Approved-by: Joshua Toliver
  • Loading branch information
aespinoza-quoin authored and jtoliver-quoin committed Feb 29, 2024
2 parents dd3c281 + 64092b0 commit e04165a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/schedules/recalculate_age_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@
before do
clean_data(Child)
25.times do |index|
Child.create(data: { name: "case#{index}'", date_of_birth: Date.today - index.years })
Child.create(data: { name: "case#{index}'", date_of_birth: Date.current - index.years })
end
@case31 = Child.create(data: { name: "case21'", date_of_birth: Date.today - 5.days })
@case32 = Child.create(data: { name: "case22'", date_of_birth: Date.today - 5.months })
@case31 = Child.create(data: { name: "case21'", date_of_birth: Date.current - 5.days })
@case32 = Child.create(data: { name: "case22'", date_of_birth: Date.current - 5.months })
Sunspot.commit
end

it 'should return total pages and total_count' do
search = RecalculateAge.new.cases_by_date_of_birth_range(Date.today, Date.today)
search = RecalculateAge.new.cases_by_date_of_birth_range(Date.current, Date.current)
expect(search.count).to eq(25)
end
it 'should not find cases with birthdays not today' do
expect(RecalculateAge.new.cases_by_date_of_birth_range(Date.today, Date.today)).not_to include(
expect(RecalculateAge.new.cases_by_date_of_birth_range(Date.current, Date.current)).not_to include(
@case31, @case32
)
end
Expand Down

0 comments on commit e04165a

Please sign in to comment.