Skip to content

Commit

Permalink
Revert "Include task_id in result of ResourceActionWorkflow#process_r…
Browse files Browse the repository at this point in the history
…equest"

This reverts commit 25be312.
  • Loading branch information
skateman committed Aug 2, 2018
1 parent e83fd17 commit c211bf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/models/resource_action_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def process_request(state)
result[:request] = generate_request(state, values)
else
ra = load_resource_action(values)
result[:task_id] = ra.deliver_to_automate_from_dialog(values, @target, @requester).id
ra.deliver_to_automate_from_dialog(values, @target, @requester)
end

result
Expand Down
11 changes: 4 additions & 7 deletions spec/models/resource_action_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,9 @@
end
end

describe "#submit_request" do
context "#submit_request" do
subject { ResourceActionWorkflow.new({}, admin, resource_action, :target => target) }
let(:resource_action) { @resource_action }
let(:task) { double }

before { allow(task).to receive(:id).and_return(123) }

context "with request class" do
let(:target) { FactoryGirl.create(:service) }
Expand Down Expand Up @@ -87,10 +84,10 @@
EvmSpecHelper.local_miq_server
expect(subject).not_to receive(:make_request)
expect_any_instance_of(ResourceAction).to receive(:deliver_to_automate_from_dialog).and_call_original
expect(MiqAeEngine).to receive(:deliver_queue).and_return(task) # calls into automate
expect(MiqAeEngine).to receive(:deliver_queue) # calls into automate
expect(AuditEvent).not_to receive(:success)
response = subject.submit_request
expect(response).to eq(:errors => [], :task_id => 123)
expect(response).to eq(:errors => [])
end
end

Expand All @@ -104,7 +101,7 @@

it "calls automate" do
expect(subject).not_to receive(:make_request)
expect_any_instance_of(ResourceAction).to receive(:deliver_to_automate_from_dialog).and_return(task)
expect_any_instance_of(ResourceAction).to receive(:deliver_to_automate_from_dialog)

subject.submit_request
end
Expand Down

0 comments on commit c211bf0

Please sign in to comment.