aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-05-18 15:36:22 +0200
committerXinhui2017-05-18 15:36:33 +0200
commit8872c4707b806ff4ae412de99a561495c20fbc51 (patch)
treeb8d8b9b862aa7fab7e079f59d6d8864ad279189d
parent67826cc4b449efe03421863dc4d49e26d84f4524 (diff)
downloadchouette-core-8872c4707b806ff4ae412de99a561495c20fbc51.tar.bz2
Fix TimeTableCombination spec
-rw-r--r--app/models/time_table_combination.rb2
-rw-r--r--spec/models/time_table_combination_spec.rb27
2 files changed, 19 insertions, 10 deletions
diff --git a/app/models/time_table_combination.rb b/app/models/time_table_combination.rb
index 6cbdf942f..f9b63340a 100644
--- a/app/models/time_table_combination.rb
+++ b/app/models/time_table_combination.rb
@@ -12,7 +12,7 @@ class TimeTableCombination
def clean
self.source_id = nil
self.target_id = nil
- self.time_table_id = nil
+ self.combined_type = nil
self.operation = nil
self.errors.clear
end
diff --git a/spec/models/time_table_combination_spec.rb b/spec/models/time_table_combination_spec.rb
index 059fe9e81..60dcdb5b0 100644
--- a/spec/models/time_table_combination_spec.rb
+++ b/spec/models/time_table_combination_spec.rb
@@ -48,9 +48,12 @@ describe TimeTableCombination, :type => :model do
combined.int_day_types = 508
combined.periods << Chouette::TimeTablePeriod.new(:period_start => Date.new(2014,8,15), :period_end => Date.new(2014,9,15))
combined.save
- subject.operation = 'union'
- subject.source_id = source.id
- subject.combined_id = combined.id
+
+ subject.operation = 'union'
+ subject.source_id = source.id
+ subject.target_id = combined.id
+ subject.combined_type = 'time_table'
+
subject.combine
source.reload
end
@@ -73,9 +76,12 @@ describe TimeTableCombination, :type => :model do
combined.int_day_types = 508
combined.periods << Chouette::TimeTablePeriod.new(:period_start => Date.new(2014,8,15), :period_end => Date.new(2014,9,15))
combined.save
- subject.operation = 'intersection'
- subject.source_id = source.id
- subject.combined_id = combined.id
+
+ subject.operation = 'intersection'
+ subject.source_id = source.id
+ subject.target_id = combined.id
+ subject.combined_type = 'time_table'
+
subject.combine
source.reload
end
@@ -102,9 +108,12 @@ describe TimeTableCombination, :type => :model do
combined.int_day_types = 508
combined.periods << Chouette::TimeTablePeriod.new(:period_start => Date.new(2014,8,15), :period_end => Date.new(2014,9,15))
combined.save
- subject.operation = 'disjunction'
- subject.source_id = source.id
- subject.combined_id = combined.id
+
+ subject.operation = 'disjunction'
+ subject.source_id = source.id
+ subject.target_id = combined.id
+ subject.combined_type = 'time_table'
+
subject.combine
source.reload
end