From 6cceca658d93a38c5cca3d625076995685d737bb Mon Sep 17 00:00:00 2001 From: L Galis Date: Tue, 22 May 2018 12:33:56 -0400 Subject: [PATCH] Add spec for option to clear classifications when calling tag_details --- spec/lib/miq_expression_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/lib/miq_expression_spec.rb b/spec/lib/miq_expression_spec.rb index fdfc1225f5a0..e4c1dea2bb32 100644 --- a/spec/lib/miq_expression_spec.rb +++ b/spec/lib/miq_expression_spec.rb @@ -3340,6 +3340,27 @@ actual = described_class.tag_details(nil, {}) expect(actual).to eq([["My Company Tags : Environment", "managed-env"]]) end + + it "returns the tags when no path is given" do + Tenant.seed + FactoryGirl.create( + :classification, + :name => "first_classification", + :description => "First Classification", + :children => [FactoryGirl.create(:classification)] + ) + actual = described_class.tag_details(nil, {}) + expect(actual).to eq([["My Company Tags : First Classification", "managed-first_classification"]]) + + FactoryGirl.create( + :classification, + :name => "second_classification", + :description => "Second Classification", + :children => [FactoryGirl.create(:classification)] + ) + actual = described_class.tag_details(nil, {:clear_classifications => true}) + expect(actual).to eq([["My Company Tags : First Classification", "managed-first_classification"], ["My Company Tags : Second Classification", "managed-second_classification"]]) + end end describe "miq_adv_search_lists" do