Skip to content

Commit ba67c2d

Browse files
committed
Can't push apps with app manifests if routes were shared
Fix robocop errors
1 parent a444696 commit ba67c2d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app/actions/manifest_route_update.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,10 @@ def find_or_create_valid_route(app, manifest_route, user_audit_info)
9292
domain: existing_domain,
9393
manifest_triggered: true
9494
)
95-
elsif route.space.guid != app.space_guid
95+
elsif route.space.guid != app.space_guid
9696
# check if route is shared with space
9797
spaces = route.shared_spaces
98-
if (spaces.blank?) || (!spaces.any? { |space| space.values[:id] == app.space.id })
99-
raise InvalidRoute.new('Routes cannot be mapped to destinations in different spaces')
100-
end
98+
raise InvalidRoute.new('Routes cannot be mapped to destinations in different spaces') if spaces.blank? || !spaces.any? { |space| space.values[:id] == app.space.id }
10199
elsif manifest_route[:options] && route[:options] != manifest_route[:options]
102100
# remove nil values from options
103101
manifest_route[:options] = manifest_route[:options].compact

spec/unit/actions/manifest_route_update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module VCAP::CloudController
127127
let!(:outside_app) { AppModel.make }
128128
let!(:shared_route) { route_share.create(route, [outside_app.space], user_audit_info) }
129129

130-
it 'succeeds after route share' do
130+
it 'succeeds after route share' do
131131
expect do
132132
ManifestRouteUpdate.update(outside_app.guid, message, user_audit_info)
133133
end.not_to raise_error

0 commit comments

Comments
 (0)