From 27c1dbdae8568dc33a6606413f83c82cbf08d864 Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Tue, 17 Jul 2018 11:06:19 -0400 Subject: [PATCH] Fix class name for queueing Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1601930 --- app/models/service_template.rb | 2 +- spec/models/service_template_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/models/service_template.rb b/app/models/service_template.rb index 32d853ccc71..56ddcbf45aa 100644 --- a/app/models/service_template.rb +++ b/app/models/service_template.rb @@ -399,7 +399,7 @@ def provision_request(user, options = nil, request_options = nil) def queue_order(user_id, options, request_options) MiqQueue.submit_job( - :class_name => name, + :class_name => self.class.name, :instance_id => id, :method_name => "order", :args => [user_id, options, request_options], diff --git a/spec/models/service_template_spec.rb b/spec/models/service_template_spec.rb index 239bc9d4ea2..79ac76a84c9 100644 --- a/spec/models/service_template_spec.rb +++ b/spec/models/service_template_spec.rb @@ -844,6 +844,19 @@ ) end + it "#queue_order" do + EvmSpecHelper.local_miq_server + + service_template.queue_order(user.id, {}, {}) + + expect(MiqQueue.first).to have_attributes( + :args => [user.id, {}, {}], + :class_name => "ServiceTemplate", + :instance_id => service_template.id, + :method_name => "order", + ) + end + it "successfully scheduled twice" do EvmSpecHelper.local_miq_server expect(resource_action_workflow).to receive(:validate_dialog).twice.and_return([])