Sha256: 2c259771ed4dd97ad0fd49ec794ca66c5f9169bd4155ac19624050b99d5a84ea

Contents?: true

Size: 801 Bytes

Versions: 5

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class PictureTest < ActiveSupport::TestCase
  def teardown
    @picture.destroy rescue nil
  end

  test 'Set file content_type and size' do
    @picture = create_picture

    assert_equal 'rails.png', @picture.data_file_name unless CKEDITOR_BACKEND == :shrine
    case CKEDITOR_BACKEND
    when :dragonfly
      assert @picture.url_thumb.include?('thumb_rails')
    when :active_storage
      assert @picture.url_thumb =~ /\/representations\/.*\/rails.png/
    when :shrine
      assert @picture.url_thumb =~ /\S{32}\.png/
      assert @picture.data_file_name =~ /image_processing(\d{8})-(\d{5})-(\S{,7})\.png/
    else
      assert @picture.url_thumb.include?('thumb_rails.png')
    end

    assert_equal 6646, @picture.data_file_size
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ckeditor-5.1.1 test/models/picture_test.rb
glebtv-ckeditor-4.14.1 test/models/picture_test.rb
ckeditor-5.1.0 test/models/picture_test.rb
glebtv-ckeditor-4.13.1 test/models/picture_test.rb
glebtv-ckeditor-4.13.0 test/models/picture_test.rb