Skip to content

Commit

Permalink
Merge pull request ManageIQ#18737 from agrare/add_test_for_tag2human
Browse files Browse the repository at this point in the history
Add a spec test for Classification.tag2human
  • Loading branch information
gtanzillo authored May 6, 2019
2 parents 626ab73 + 38f20f5 commit 2891bc3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/models/classification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@
end
end

describe '.tag2human' do
let!(:classification) { FactoryBot.create(:classification_department_with_tags) }

it 'returns a human readible name' do
tag = Tag.find_by(:name => "/managed/department/hr")
expect(described_class.tag2human(tag.name)).to eq("Department: Human Resources")
end
end

def all_tagged_with(target, all, category = nil)
tagged_with(target, :all => all, :cat => category)
end
Expand Down

0 comments on commit 2891bc3

Please sign in to comment.