Commit 481eac05 authored by Alexandre Friquet's avatar Alexandre Friquet
Browse files

Fixes issue when time between min date and max date less than one year: refs #97.

parent 555cb9c2
......@@ -54,6 +54,8 @@ class Season
date += 1.year
break if date > max_date
seasons <<
......@@ -128,8 +128,7 @@ RSpec.describe Season, type: :model do
it "based on :begin_at if no field provided" do
# Given
create :event, begin_at:,4,1)
create :event, begin_at:,9,1)
create :event, begin_at:,8,31)
create :event, begin_at:,3,31)
expected = ["2016-2017","2017-2018"]
# When
result = Season.all(Event)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment