aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAlban Peignier2018-04-26 00:44:42 +0200
committerAlban Peignier2018-04-26 00:45:13 +0200
commit499a4785f3c6108202bbc19926a46ff548637bb1 (patch)
treec57d9356474e775f906196e448edcd0c758cab2f /spec
parent05fd553395ac66359b1be7428c9b28ced432bd0a (diff)
downloadchouette-core-499a4785f3c6108202bbc19926a46ff548637bb1.tar.bz2
Avoid problem in merge specs with route checksum (problem not reproduced in real condition)
Diffstat (limited to 'spec')
-rw-r--r--spec/models/merge_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/models/merge_spec.rb b/spec/models/merge_spec.rb
index 685e675cd..242fcddcd 100644
--- a/spec/models/merge_spec.rb
+++ b/spec/models/merge_spec.rb
@@ -40,12 +40,15 @@ RSpec.describe Merge do
checksum = route.checksum
routing_constraint_zones[route.id] = {}
2.times do |i|
- constraint_zone = create(:routing_constraint_zone, route: route)
+ constraint_zone = create(:routing_constraint_zone, route_id: route.id)
if i > 0
constraint_zone.update stop_points: constraint_zone.stop_points[0...-1]
end
routing_constraint_zones[route.id][constraint_zone.checksum] = constraint_zone
end
+
+ route.reload.update_checksum!
+
expect(route.reload.checksum).to_not eq checksum
factor.times do
FactoryGirl.create :journey_pattern, route: route, stop_points: route.stop_points.sample(3)