Sha256: 25187382ea3bb73e767f33f7bdae5f8dcd38a72ab34d9ed2972a5725e06e8c36

Contents?: true

Size: 832 Bytes

Versions: 8

Compression:

Stored size: 832 Bytes

Contents

require 'test_helper'

class UtilsTest < ActiveSupport::TestCase
  test 'exists filethumb' do
    %w(avi doc docx exe gz htm jpg mp3 mpg pdf psd rar swf tar txt wmv xlsx zip).each do |ext|
      assert_equal "ckeditor/filebrowser/thumbs/#{ext}.gif", Ckeditor::Utils.filethumb("somefile.#{ext}")
    end

    assert_equal "ckeditor/filebrowser/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile.ddd")
  end

  test 'wrong filethumb' do
    assert_equal "ckeditor/filebrowser/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile.ddd")
    assert_equal "ckeditor/filebrowser/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile")
    assert_equal "ckeditor/filebrowser/thumbs/unknown.gif", Ckeditor::Utils.filethumb("")
    assert_equal "ckeditor/filebrowser/thumbs/unknown.gif", Ckeditor::Utils.filethumb(nil)
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.11.1 test/models/utils_test.rb
ckeditor-4.3.0 test/models/utils_test.rb
glebtv-ckeditor-4.7.3.1 test/models/utils_test.rb
glebtv-ckeditor-4.7.3 test/models/utils_test.rb
ckeditor-4.2.4 test/models/utils_test.rb
ckeditor-4.2.3 test/models/utils_test.rb
ckeditor-4.2.2 test/models/utils_test.rb
ckeditor-4.2.1 test/models/utils_test.rb