diff options
| -rw-r--r-- | app/models/time_table_combination.rb | 2 | ||||
| -rw-r--r-- | spec/models/time_table_combination_spec.rb | 27 |
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 |
