From 499a4785f3c6108202bbc19926a46ff548637bb1 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Thu, 26 Apr 2018 00:44:42 +0200 Subject: Avoid problem in merge specs with route checksum (problem not reproduced in real condition) --- spec/models/merge_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3