Improve specs

This commit is contained in:
Clement Ho 2017-04-24 10:14:34 -04:00
parent 7f66e8ad17
commit ffe4e5c74d

View file

@ -4,12 +4,14 @@ describe IconsHelper do
describe 'icon' do describe 'icon' do
it 'returns aria-hidden by default' do it 'returns aria-hidden by default' do
star = icon('star') star = icon('star')
expect(star['aria-hidden']).to eq 'aria-hidden' expect(star['aria-hidden']).to eq 'aria-hidden'
end end
it 'does not return aria-hidden if aria-label is set' do it 'does not return aria-hidden if aria-label is set' do
up = icon('up', 'aria-label' => 'up') up = icon('up', 'aria-label' => 'up')
expect(up['aria-hidden']).to eq nil
expect(up['aria-hidden']).to be_nil
expect(up['aria-label']).to eq 'aria-label' expect(up['aria-label']).to eq 'aria-label'
end end
end end