Skip to content

Commit

Permalink
Merge pull request #17717 from bdunne/fix_class_name
Browse files Browse the repository at this point in the history
Fix class name for queueing
  • Loading branch information
gmcculloug authored Jul 17, 2018
2 parents 3dc7d6d + 27c1dbd commit 450a9a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
13 changes: 13 additions & 0 deletions spec/models/service_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down

0 comments on commit 450a9a0

Please sign in to comment.