Skip to content

Commit

Permalink
changed log_file_spec: after linking miq_tasks and miq_queue tables t…
Browse files Browse the repository at this point in the history
…here is extra parameter added to the hash when message delivered - miq_task_id
  • Loading branch information
yrudman committed Mar 16, 2018
1 parent 079d10c commit f7653b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spec/models/log_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@
end

it "delivering MiqServer._request_logs message should call _post_my_logs with correct args" do
expected_options = {:timeout => described_class::LOG_REQUEST_TIMEOUT, :taskid => @task.id, :callback => {:instance_id => @task.id, :class_name => 'MiqTask', :method_name => :queue_callback_on_exceptions, :args => ['Finished']}}
expected_options = {:timeout => described_class::LOG_REQUEST_TIMEOUT,
:taskid => @task.id, :miq_task_id => nil,
:callback => {:instance_id => @task.id, :class_name => 'MiqTask',
:method_name => :queue_callback_on_exceptions, :args => ['Finished']}}
expect_any_instance_of(MiqServer).to receive(:_post_my_logs).with(expected_options)

@message.delivered(*@message.deliver)
Expand All @@ -88,7 +91,7 @@
end

it "MiqServer#post_logs message should have correct args" do
expect(message.args).to eq([{:taskid => @task.id}])
expect(message.args).to eq([{:taskid => @task.id, :miq_task_id => nil}])
expect(message.priority).to eq(MiqQueue::HIGH_PRIORITY)
expect(message.miq_callback).to eq(:instance_id => @task.id, :class_name => 'MiqTask', :method_name => :queue_callback_on_exceptions, :args => ['Finished'])
expect(message.msg_timeout).to eq(described_class::LOG_REQUEST_TIMEOUT)
Expand Down

0 comments on commit f7653b0

Please sign in to comment.