From 374a2e5f0f71b08246b9bb3412440dc548b04854 Mon Sep 17 00:00:00 2001 From: Yuri Rudman Date: Tue, 17 Apr 2018 09:22:50 -0400 Subject: [PATCH] testing initialization on MiqQueue#miq_task_id --- spec/models/metric/ci_mixin/capture_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/models/metric/ci_mixin/capture_spec.rb b/spec/models/metric/ci_mixin/capture_spec.rb index c0711a919763..aca117112152 100644 --- a/spec/models/metric/ci_mixin/capture_spec.rb +++ b/spec/models/metric/ci_mixin/capture_spec.rb @@ -355,6 +355,13 @@ def verify_perf_capture_queue(last_perf_capture_on, total_queue_items) verify_perf_capture_queue(last_perf_capture_on, 11) end end + + it "links supplied miq_task with queued item which allow to initialize MiqTask#started_on attribute" do + MiqQueue.delete_all + task = FactoryGirl.create(:miq_task) + vm.perf_capture_queue("realtime", :task_id => task.id) + expect(MiqQueue.first.miq_task_id).to eq task.id + end end describe "#perf_capture_queue('historical')" do