diff --git a/spec/tools/copy_reports_structure_spec.rb b/spec/tools/copy_reports_structure_spec.rb index 9a38c993ce9..6194837363e 100644 --- a/spec/tools/copy_reports_structure_spec.rb +++ b/spec/tools/copy_reports_structure_spec.rb @@ -9,6 +9,15 @@ let(:source_group) { FactoryGirl.create(:miq_group, :settings => settings) } let(:destination_group) { FactoryGirl.create(:miq_group, :miq_user_role => role) } + before do + @saved_stdout, @saved_stderr = $stdout, $stderr + $stdout = $stderr = StringIO.new + end + + after do + $stdout, $stderr = @saved_stdout, @saved_stderr + end + context "copy reports structure" do describe ".duplicate_for_group" do it "copies reports structure from one group to another" do @@ -23,7 +32,7 @@ expect(destination_group.settings).to be nil end - it "does not change reports structure on destination group is source group not found" do + it "does not change reports structure on destination group if source group not found" do expect(ReportStructure).to receive(:abort) ReportStructure.duplicate_for_group("Some_Not_existed_Group", source_group.description) source_group.reload @@ -52,7 +61,7 @@ expect(@destination_group2.settings).to be nil end - it "does not change reports structure on group with destination role is source group not found" do + it "does not change reports structure on group with destination role if source group not found" do destination_group.update(:settings => settings) expect(ReportStructure).to receive(:abort) ReportStructure.duplicate_for_role("Some_Not_existed_Group", role.name)