Skip to content

Commit

Permalink
Merge pull request #407 from d-m-u/bz1584355_master
Browse files Browse the repository at this point in the history
Add option to reuse dialog values for great justice on master
  • Loading branch information
gtanzillo authored Jul 3, 2018
2 parents d826a71 + 6d9a8da commit 39e81ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/mixins/service_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ServiceTemplates
def order_service_template(id, data, scheduled_time = nil)
service_template = resource_search(id, :service_templates, ServiceTemplate)
raise BadRequestError, "#{service_template_ident(service_template)} cannot be ordered" unless service_template.orderable?
request_result = service_template.order(User.current_user, (data || {}), nil, scheduled_time)
request_result = service_template.order(User.current_user, (data || {}), {:submit_workflow => true}, scheduled_time)
errors = request_result[:errors]
if errors.present?
raise BadRequestError, "Failed to order #{service_template_ident(service_template)} - #{errors.join(", ")}"
Expand Down
3 changes: 2 additions & 1 deletion spec/requests/service_templates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
post(api_service_templates_url, :params => { :action => "order", :resources => [{:href => api_service_template_url(nil, service_template)}] })

expected = {
"results" => [a_hash_including("href" => a_string_including(api_service_requests_url))]
"results" => [a_hash_including("href" => a_string_including(api_service_requests_url),
"options" => a_hash_including("request_options" => a_hash_including("submit_workflow"=>true)))]
}
expect(response).to have_http_status(:ok)
expect(response.parsed_body).to include(expected)
Expand Down

0 comments on commit 39e81ec

Please sign in to comment.