Skip to content

Commit

Permalink
Add service_action.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaafitz committed Feb 3, 2017
1 parent 98394e9 commit 4c293b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ def create_resource_actions(ae_endpoints)
ae_endpoint[:fqname]
end

build_options = {:action => action[:name], :fqname => fqname}
build_options = {:action => action[:name],
:fqname => fqname,
:ae_attributes => {:service_action => action[:name]}}
build_options.merge!(ae_endpoint.slice(:dialog,
:dialog_id,
:configuration_template,
Expand Down
1 change: 1 addition & 0 deletions spec/models/service_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@
expect(service_template.service_resources.first.resource_type).to eq('MiqRequest')
expect(service_template.dialogs.first).to eq(service_dialog)
expect(service_template.resource_actions.pluck(:action)).to include('Provision', 'Retirement')
expect(service_template.resource_actions.pluck(:ae_attributes)).to include({:service_action=>"Provision"}, {:service_action=>"Retirement"})
expect(service_template.resource_actions.first.dialog).to eq(service_dialog)
expect(service_template.resource_actions.last.dialog).to eq(service_dialog)
end
Expand Down

0 comments on commit 4c293b4

Please sign in to comment.