diff options
author | Sullivan SENECHAL <soullivaneuh@gmail.com> | 2014-10-04 12:29:18 +0200 |
---|---|---|
committer | Sullivan SENECHAL <soullivaneuh@gmail.com> | 2015-03-28 16:49:05 +0100 |
commit | 8ef7220c2316810e2a9bd784f22d25b4a073c138 (patch) | |
tree | c4a0398366e34aca7620ff7417fb44564392630d /spec | |
parent | db948ff3d6a72620391c7cb0f169334cef0438c7 (diff) | |
download | gitlab-ce-8ef7220c2316810e2a9bd784f22d25b4a073c138.tar.gz |
Improve file icons rendering on tree
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/icons_helper_spec.rb | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb new file mode 100644 index 00000000000..0b1cf07b7b0 --- /dev/null +++ b/spec/helpers/icons_helper_spec.rb @@ -0,0 +1,109 @@ +require 'spec_helper' + +describe IconsHelper do + describe 'file_type_icon_class' do + it 'returns folder class' do + expect(file_type_icon_class('folder', 0, 'folder_name')).to eq 'folder' + end + + it 'returns share class' do + expect(file_type_icon_class('file', 0120000, 'link')).to eq 'share' + end + + it 'returns file-pdf-o class with .pdf' do + expect(file_type_icon_class('file', 0, 'filename.pdf')).to eq 'file-pdf-o' + end + + it 'returns file-image-o class with .jpg' do + expect(file_type_icon_class('file', 0, 'filename.jpg')).to eq 'file-image-o' + end + + it 'returns file-image-o class with .JPG' do + expect(file_type_icon_class('file', 0, 'filename.JPG')).to eq 'file-image-o' + end + + it 'returns file-image-o class with .png' do + expect(file_type_icon_class('file', 0, 'filename.png')).to eq 'file-image-o' + end + + it 'returns file-archive-o class with .tar' do + expect(file_type_icon_class('file', 0, 'filename.tar')).to eq 'file-archive-o' + end + + it 'returns file-archive-o class with .TAR' do + expect(file_type_icon_class('file', 0, 'filename.TAR')).to eq 'file-archive-o' + end + + it 'returns file-archive-o class with .tar.gz' do + expect(file_type_icon_class('file', 0, 'filename.tar.gz')).to eq 'file-archive-o' + end + + it 'returns file-audio-o class with .mp3' do + expect(file_type_icon_class('file', 0, 'filename.mp3')).to eq 'file-audio-o' + end + + it 'returns file-audio-o class with .MP3' do + expect(file_type_icon_class('file', 0, 'filename.MP3')).to eq 'file-audio-o' + end + + it 'returns file-audio-o class with .wav' do + expect(file_type_icon_class('file', 0, 'filename.wav')).to eq 'file-audio-o' + end + + it 'returns file-video-o class with .avi' do + expect(file_type_icon_class('file', 0, 'filename.avi')).to eq 'file-video-o' + end + + it 'returns file-video-o class with .AVI' do + expect(file_type_icon_class('file', 0, 'filename.AVI')).to eq 'file-video-o' + end + + it 'returns file-video-o class with .mp4' do + expect(file_type_icon_class('file', 0, 'filename.mp4')).to eq 'file-video-o' + end + + it 'returns file-word-o class with .doc' do + expect(file_type_icon_class('file', 0, 'filename.doc')).to eq 'file-word-o' + end + + it 'returns file-word-o class with .DOC' do + expect(file_type_icon_class('file', 0, 'filename.DOC')).to eq 'file-word-o' + end + + it 'returns file-word-o class with .docx' do + expect(file_type_icon_class('file', 0, 'filename.docx')).to eq 'file-word-o' + end + + it 'returns file-excel-o class with .xls' do + expect(file_type_icon_class('file', 0, 'filename.xls')).to eq 'file-excel-o' + end + + it 'returns file-excel-o class with .XLS' do + expect(file_type_icon_class('file', 0, 'filename.XLS')).to eq 'file-excel-o' + end + + it 'returns file-excel-o class with .xlsx' do + expect(file_type_icon_class('file', 0, 'filename.xlsx')).to eq 'file-excel-o' + end + + it 'returns file-excel-o class with .ppt' do + expect(file_type_icon_class('file', 0, 'filename.ppt')).to eq 'file-powerpoint-o' + end + + it 'returns file-excel-o class with .PPT' do + expect(file_type_icon_class('file', 0, 'filename.PPT')).to eq 'file-powerpoint-o' + end + + it 'returns file-excel-o class with .pptx' do + expect(file_type_icon_class('file', 0, 'filename.pptx')).to eq 'file-powerpoint-o' + end + + it 'returns file-text-o class with .unknow' do + expect(file_type_icon_class('file', 0, 'filename.unknow')).to eq 'file-text-o' + end + + it 'returns file-text-o class with no extension' do + expect(file_type_icon_class('file', 0, 'CHANGELOG')).to eq 'file-text-o' + end + end +end |