Skip to content

Commit

Permalink
Add :fqname to list of updatable attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bzwei committed May 4, 2017
1 parent c7d8bcf commit dcece3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ServiceTemplate < ApplicationRecord

RESOURCE_ACTION_UPDATE_ATTRS = [:dialog,
:dialog_id,
:fqname,
:configuration_template,
:configuration_template_id,
:configuration_template_type].freeze
Expand Down
6 changes: 4 additions & 2 deletions spec/models/service_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,11 @@
:instance_type => [flavor.id, flavor.name],
:src_ems_id => [ems.id, ems.name],
:provision => {
:fqname => ra1.fqname,
:fqname => 'a1/b1/c1',
:dialog_id => nil
},
:reconfigure => {
:fqname => ra3.fqname,
:fqname => 'x1/y1/z1',
:dialog_id => service_dialog.id
}
}
Expand All @@ -608,7 +608,9 @@
# Removes Retirement / Adds Reconfigure
expect(updated.resource_actions.pluck(:action)).to match_array(%w(Provision Reconfigure))
expect(updated.resource_actions.first.dialog_id).to be_nil # Removes the dialog from Provision
expect(updated.resource_actions.first.fqname).to eq('/a1/b1/c1')
expect(updated.resource_actions.last.dialog).to eq(service_dialog)
expect(updated.resource_actions.last.fqname).to eq('/x1/y1/z1')
expect(updated.name).to eq('Updated Template Name')
expect(updated.service_resources.first.resource.source_id).to eq(new_vm.id) # Validate request update
expect(updated.config_info).to eq(updated_catalog_item_options[:config_info])
Expand Down

0 comments on commit dcece3e

Please sign in to comment.