diff --git a/product/dashboard/widgets/chart_guest_os_information_any_os.yaml b/product/dashboard/widgets/chart_guest_os_information_any_os.yaml index 9c022178d8d..3984962e0da 100644 --- a/product/dashboard/widgets/chart_guest_os_information_any_os.yaml +++ b/product/dashboard/widgets/chart_guest_os_information_any_os.yaml @@ -2,6 +2,7 @@ description: chart_guest_os_information_any_os title: Guest OS Information content_type: chart options: + :timezone_matters: false visibility: :roles: - _ALL_ @@ -14,4 +15,4 @@ miq_schedule_options: :value: "1" :unit: daily enabled: true -read_only: true \ No newline at end of file +read_only: true diff --git a/product/dashboard/widgets/chart_vendor_and_guest_os.yaml b/product/dashboard/widgets/chart_vendor_and_guest_os.yaml index 6f31e5462d6..08937f7d18f 100644 --- a/product/dashboard/widgets/chart_vendor_and_guest_os.yaml +++ b/product/dashboard/widgets/chart_vendor_and_guest_os.yaml @@ -2,6 +2,7 @@ description: chart_vendor_and_guest_os title: Vendor and Guest OS Chart content_type: chart options: + :timezone_matters: false visibility: :roles: - _ALL_ @@ -14,4 +15,4 @@ miq_schedule_options: :value: "1" :unit: daily enabled: true -read_only: true \ No newline at end of file +read_only: true diff --git a/product/dashboard/widgets/report_top_storage_consumers.yaml b/product/dashboard/widgets/report_top_storage_consumers.yaml index e951e707759..4cc77497cc8 100644 --- a/product/dashboard/widgets/report_top_storage_consumers.yaml +++ b/product/dashboard/widgets/report_top_storage_consumers.yaml @@ -7,6 +7,7 @@ options: - ems_cluster.name - used_disk_storage :row_count: 10 + :timezone_matters: false visibility: :roles: - _ALL_ @@ -19,4 +20,4 @@ miq_schedule_options: :value: "1" :unit: daily enabled: true -read_only: true \ No newline at end of file +read_only: true diff --git a/spec/models/miq_widget_spec.rb b/spec/models/miq_widget_spec.rb index de1ec42b8a6..5997cae8926 100644 --- a/spec/models/miq_widget_spec.rb +++ b/spec/models/miq_widget_spec.rb @@ -566,6 +566,8 @@ def add_dashboard_for_user(db_name, userid, group) MiqReport.seed_report("Vendor and Guest OS") MiqWidget.seed_widget("chart_vendor_and_guest_os") + # tests are written for timezone_matters = true + widget.options[:timezone_matters] = true if widget.options @role = FactoryGirl.create(:miq_user_role) @group = FactoryGirl.create(:miq_group, :miq_user_role => @role) @user1 = FactoryGirl.create(:user, @@ -591,14 +593,15 @@ def add_dashboard_for_user(db_name, userid, group) before do widget.make_memberof(@ws1) widget.make_memberof(@ws2) - widget.queue_generate_content end it "queued based on group/TZs of User's in the group" do + widget.queue_generate_content expect(MiqQueue.count).to eq(1) end it "contents created for each timezone of the group" do + widget.queue_generate_content MiqQueue.first.deliver expect(MiqWidgetContent.count).to eq(2) MiqWidgetContent.all.each do |content| @@ -608,7 +611,20 @@ def add_dashboard_for_user(db_name, userid, group) end end + it "contents created for one timezone per group with timezone_matters = false" do + widget.options = {:timezone_matters => false } + widget.queue_generate_content + MiqQueue.first.deliver + expect(MiqWidgetContent.count).to eq(1) + MiqWidgetContent.all.each do |content| + expect(content.user_id).to be_nil + expect(content.miq_group_id).to eq(@group.id) + expect(content.timezone).to eq("UTC") + end + end + it "when changing to self service group" do + widget.queue_generate_content MiqQueue.first.deliver MiqWidgetContent.all.each do |content| expect(content.user_id).to be_nil