Sha256: 7d9cfce182e3fc2f88b37775818b5fd11467d41144dcf49ea306ebb0b652c49d

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

require 'active_support/test_case'
require 'action_dispatch/testing/test_process'

class ActiveSupport::TestCase
  include ActionDispatch::TestProcess

  def new_attachment(data = nil)
    data ||= fixture_file_upload('files/rails.tar.gz', 'application/x-gzip')

    Ckeditor.attachment_file_model.new(:data => data)
  end

  def create_attachment(data = nil)
    attachment = new_attachment(data)
    attachment.save!
    attachment
  end

  def new_picture(data = nil)
    data ||= fixture_file_upload('files/rails.png', 'image/png')

    Ckeditor.picture_model.new(:data => data)
  end

  def create_picture(data = nil)
    picture = new_picture(data)
    picture.save!
    picture
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ckeditor-5.1.1 test/support/helpers.rb
glebtv-ckeditor-4.14.1 test/support/helpers.rb
ckeditor-5.1.0 test/support/helpers.rb
glebtv-ckeditor-4.13.1 test/support/helpers.rb
glebtv-ckeditor-4.13.0 test/support/helpers.rb
ckeditor-5.0.0 test/support/helpers.rb