aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMichel Etienne2015-06-09 17:31:10 +0200
committerMichel Etienne2015-06-09 17:31:10 +0200
commit89594ced7a12d863b98884d036b13a557c01e319 (patch)
tree65eac1a296514649baf224938ca4a7c494c7ad89 /spec
parent08bc55c292373a1cc875d8a078520caf9e116de0 (diff)
downloadchouette-core-89594ced7a12d863b98884d036b13a557c01e319.tar.bz2
correct timetable combination spec
Diffstat (limited to 'spec')
-rw-r--r--spec/models/time_table_combination_spec.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/models/time_table_combination_spec.rb b/spec/models/time_table_combination_spec.rb
index 7b6f9638e..46d5f8504 100644
--- a/spec/models/time_table_combination_spec.rb
+++ b/spec/models/time_table_combination_spec.rb
@@ -49,10 +49,12 @@ describe TimeTableCombination, :type => :model do
source.reload
end
it "should intersect combined to source" do
- expect(source.periods.size).to eq(1)
- expect(source.periods[0].period_start).to eq(Date.new(2014,8,15))
- expect(source.periods[0].period_end).to eq(Date.new(2014,8,31))
- end
+ expect(source.int_day_types).to eq(0)
+ expect(source.periods.size).to eq(0)
+ expect(source.dates.size).to eq(17)
+ expect(source.dates[0].date).to eq(Date.new(2014,8,15))
+ expect(source.dates[16].date).to eq(Date.new(2014,8,31))
+ end
end
context "when operation is disjoin" do
before(:each) do
@@ -73,9 +75,11 @@ describe TimeTableCombination, :type => :model do
source.reload
end
it "should disjoin combined to source" do
- expect(source.periods.size).to eq(1)
- expect(source.periods[0].period_start).to eq(Date.new(2014,8,1))
- expect(source.periods[0].period_end).to eq(Date.new(2014,8,14))
+ expect(source.int_day_types).to eq(0)
+ expect(source.periods.size).to eq(0)
+ expect(source.dates.size).to eq(14)
+ expect(source.dates[0].date).to eq(Date.new(2014,8,1))
+ expect(source.dates[13].date).to eq(Date.new(2014,8,14))
end
end
end