Sha256: 33dea76f330012040aa4688c310518e3d7b1450cf8178e1e498a959844e5aca6

Contents?: true

Size: 643 Bytes

Versions: 3

Compression:

Stored size: 643 Bytes

Contents

require 'test_helper'

class AttachmentFileTest < ActiveSupport::TestCase
  def teardown
    @attachment.destroy rescue nil
  end

  test "Set file content_type and size" do
    @attachment = create_attachment

    # TODO: fix filename parameterization
    if CKEDITOR_BACKEND == :paperclip
      assert_equal "rails_tar.gz", @attachment.data_file_name
    else
      assert_equal "rails.tar.gz", @attachment.data_file_name
    end

    assert_match /application\/(x-)?gzip/, @attachment.data_content_type
    assert_equal 6823, @attachment.data_file_size
    assert_equal "ckeditor/filebrowser/thumbs/gz.gif", @attachment.url_thumb
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ckeditor-4.2.3 test/models/attachment_file_test.rb
ckeditor-4.2.2 test/models/attachment_file_test.rb
ckeditor-4.2.1 test/models/attachment_file_test.rb