Skip to content

Commit e305a88

Browse files
committed
Add nil check to manifest_route_update_spec for better error messages
The test was still occasionally failing with 'undefined method protocol for nil:NilClass' even after the dataset fix. This adds an explicit nil check to provide a clearer failure message if the route mapping is unexpectedly nil, making it easier to debug the race condition.
1 parent 50baa7b commit e305a88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/unit/actions/manifest_route_update_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ module VCAP::CloudController
6969
route_mappings = app.reload.route_mappings_dataset.where(route:)
7070

7171
expect(route_mappings.count).to eq(1)
72-
expect(route_mappings.first.protocol).to eq('http2')
72+
mapped_route = route_mappings.first
73+
expect(mapped_route).not_to be_nil
74+
expect(mapped_route.protocol).to eq('http2')
7375
end
7476
end
7577
end

0 commit comments

Comments
 (0)