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 52d0a9c commit 6cceca6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/lib/miq_expression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6cceca6

Please sign in to comment.