Skip to content

Commit

Permalink
Add spec for option to clear classifications when calling tag_details
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed May 22, 2018
1 parent 6749091 commit 28fdf79
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/lib/miq_expression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,23 @@
actual = described_class.tag_details(nil, {})
expect(actual).to eq([["My Company Tags : Environment", "managed-env"]])
end

it "returns the added classification when clear_classification option is used" 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
Expand Down

0 comments on commit 28fdf79

Please sign in to comment.