aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/calendar_spec.rb3
-rw-r--r--spec/models/chouette/time_table_spec.rb5
2 files changed, 3 insertions, 5 deletions
diff --git a/spec/models/calendar_spec.rb b/spec/models/calendar_spec.rb
index e71c2b081..4c65b9660 100644
--- a/spec/models/calendar_spec.rb
+++ b/spec/models/calendar_spec.rb
@@ -9,11 +9,12 @@ RSpec.describe Calendar, :type => :model do
it { is_expected.to be_versioned }
describe '#to_time_table' do
- let(:calendar) { create(:calendar, date_ranges: [Date.today...(Date.today + 1.month)]) }
+ let(:calendar) { create(:calendar, int_day_types: Calendar::MONDAY | Calendar::SUNDAY, date_ranges: [Date.today...(Date.today + 1.month)]) }
it 'should convert calendar to an instance of Chouette::TimeTable' do
time_table = calendar.convert_to_time_table
expect(time_table).to be_an_instance_of(Chouette::TimeTable)
+ expect(time_table.int_day_types).to eq calendar.int_day_types
expect(time_table.periods[0].period_start).to eq(calendar.periods[0].begin)
expect(time_table.periods[0].period_end).to eq(calendar.periods[0].end)
expect(time_table.dates.map(&:date)).to match_array(calendar.dates)
diff --git a/spec/models/chouette/time_table_spec.rb b/spec/models/chouette/time_table_spec.rb
index d4a726740..28197984e 100644
--- a/spec/models/chouette/time_table_spec.rb
+++ b/spec/models/chouette/time_table_spec.rb
@@ -926,6 +926,7 @@ end
end
end
end
+
describe "#validity_out_between?" do
let(:empty_tm) {build(:time_table)}
it "should be false if empty calendar" do
@@ -1068,8 +1069,6 @@ end
end
end
-
-
describe "#effective_days" do
before do
subject.periods.clear
@@ -1094,8 +1093,6 @@ end
end
end
-
-
describe "#optimize_overlapping_periods" do
before do
subject.periods.clear