From 23d5df3a4c5245cdb3b6572e57790192ef6af3c3 Mon Sep 17 00:00:00 2001 From: Yuri Rudman Date: Wed, 9 Jan 2019 11:11:18 -0500 Subject: [PATCH] added test for 'userid=' and 'group_description=' stub methods --- spec/models/miq_report_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/models/miq_report_spec.rb b/spec/models/miq_report_spec.rb index bd8314ef5a56..87312fefc646 100644 --- a/spec/models/miq_report_spec.rb +++ b/spec/models/miq_report_spec.rb @@ -847,6 +847,27 @@ def generate_html_row(is_even, tenant_name, formatted_values) end end + context "support for saving attributes which are not present in the model" do + let (:report) { FactoryBot.create(:miq_report) } + + it "does not raise error when result of #export_to_array used for mass update" do + report_hash = report.export_to_array[0].values.first + expect { MiqReport.new.update_attributes(report_hash) }.not_to raise_error + end + + describe "#userid=" do + it "does nothing and used only as stub for mass update" do + expect { report.userid = "something" }.not_to raise_error + end + end + + describe "#group_description=" do + it "does nothing and used only as stub for mass update" do + expect { report.group_description = "something" }.not_to raise_error + end + end + end + describe "#column_is_hidden?" do let(:report) do MiqReport.new(