diff --git a/app/actions/space_diff_manifest.rb b/app/actions/space_diff_manifest.rb index d46b2757ea7..6247445d8cd 100644 --- a/app/actions/space_diff_manifest.rb +++ b/app/actions/space_diff_manifest.rb @@ -51,7 +51,7 @@ def generate_diff(app_manifests, space) remove_default_missing_fields(existing_value, key, value) if nested_attribute_exists - remove_unspecified_app_features(existing_value, key, value) + remove_unspecified_app_features(existing_value, key, value) if existing_value.present? # To preserve backwards compability, we've decided to skip diffs that satisfy this conditon next if !nested_attribute_exists && %w[disk_quota disk-quota memory].include?(key) diff --git a/spec/unit/actions/space_diff_manifest_spec.rb b/spec/unit/actions/space_diff_manifest_spec.rb index 0189c596ff8..f0ba6c96154 100644 --- a/spec/unit/actions/space_diff_manifest_spec.rb +++ b/spec/unit/actions/space_diff_manifest_spec.rb @@ -251,7 +251,10 @@ module VCAP::CloudController 'name' => 'new-app' }, { - 'name' => 'newer-app' + 'name' => 'newer-app', + 'features' => { + 'ssh' => true + } } ] end @@ -259,7 +262,8 @@ module VCAP::CloudController it 'returns the correct diff' do expect(subject).to eq([ { 'op' => 'add', 'path' => '/applications/0/name', 'value' => 'new-app' }, - { 'op' => 'add', 'path' => '/applications/1/name', 'value' => 'newer-app' } + { 'op' => 'add', 'path' => '/applications/1/name', 'value' => 'newer-app' }, + { 'op' => 'add', 'path' => '/applications/1/features', 'value' => { 'ssh' => true } } ]) end end