require 'spec_helper' describe FontAwesome5Rails do include RSpecHtmlMatchers include ActionView::Context describe 'tags' do it 'should return correct class tags' do expect(fa_icon 'camera-retro').to eq '' expect(fa_icon('camera-retro', class: 'test')).to eq '' expect(fa_icon('camera-retro', class: 'fa-camera-retro')).to eq '' end it 'should return correct size tags' do expect(fa_icon 'camera-retro', size: '3x').to eq '' expect(fa_icon 'camera-retro', class: 'fa-3x', size: '3x').to eq '' expect(fa_icon 'camera-retro', size: '3x 2x').to eq '' end it 'should return correct animation tags' do expect(fa_icon 'camera-retro', animation: 'spin').to eq '' expect(fa_icon 'camera-retro', class: 'fa-spin', animation: 'spin').to eq '' expect(fa_icon 'camera-retro', animation: 'spin cog').to eq '' end it 'should return correct style tags' do expect(fa_icon 'camera-retro', style: 'color: Tomato;').to eq '' end it 'should return correct data tags' do expect(fa_icon 'camera-retro', data: {'fa-transform': 'rotate-90'}).to eq '' expect(fa_icon 'camera-retro', data: {fa_transform: 'rotate-90'}).to eq '' end it 'should return correct text tags' do expect(fa_icon 'camera-retro', text: 'Camera').to have_tag('i', with: { class: 'fas fa-camera-retro'}) expect(fa_icon 'camera-retro', text: 'Camera').to have_tag('span', text: 'Camera') expect(fa_icon 'camera-retro', text: 'Camera', style: 'color: Tomato;').to have_tag('span', text: 'Camera', with: {style: 'padding-left: 5px;color: Tomato;'}) end end end