Sha256: 62efa758e8214028b4350c177942eb57c85b0470dea0caf282f2c32225c5a782

Contents?: true

Size: 679 Bytes

Versions: 2

Compression:

Stored size: 679 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

    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/
    else
      assert @picture.url_thumb.include?('thumb_rails.png')
    end

    assert_equal 6646, @picture.data_file_size
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ckeditor-5.1.3 test/models/picture_test.rb
ckeditor-5.1.2 test/models/picture_test.rb