Sha256: 7c1668a64d5a33b89cbb817b71b9c960fd2ee7b0031aed12bddc011c79da21ec

Contents?: true

Size: 1.73 KB

Versions: 20

Compression:

Stored size: 1.73 KB

Contents

require 'test_helper'

class CkeditorTest < ActiveSupport::TestCase
  def teardown
    Ckeditor.picture_model = nil
    Ckeditor.attachment_file_model = nil
  end

  test "truth" do
    assert_kind_of Module, Ckeditor
  end

  test 'setup block yields self' do
    Ckeditor.setup do |config|
      assert_equal Ckeditor, config
    end
  end

  test 'default picture model' do
    assert_equal Ckeditor.picture_model, Ckeditor::Picture
  end

  test 'configuration specifying picture model' do
    Ckeditor.setup do |config|
      config.picture_model = CustomPicture
    end
    assert_equal Ckeditor.picture_model, CustomPicture
  end

  test 'configuration specifying picture model using block' do
    Ckeditor.setup do |config|
      config.picture_model { CustomPicture }
    end
    assert_equal Ckeditor.picture_model, CustomPicture
  end

  test 'picture model adapter' do
    assert_equal Ckeditor.picture_adapter, Ckeditor::Picture.to_adapter
  end

  test 'default attachment file model' do
    assert_equal Ckeditor.attachment_file_model, Ckeditor::AttachmentFile
  end

  test 'configuration specifying attachment file model' do
    Ckeditor.setup do |config|
      config.attachment_file_model = CustomAttachmentFile
    end
    assert_equal Ckeditor.attachment_file_model, CustomAttachmentFile
  end

  test 'configuration specifying attachment file model using block' do
    Ckeditor.setup do |config|
      config.attachment_file_model { CustomAttachmentFile }
    end
    assert_equal Ckeditor.attachment_file_model, CustomAttachmentFile
  end

  test 'attachment file model adapter' do
    assert_equal Ckeditor.attachment_file_adapter,
      Ckeditor::AttachmentFile.to_adapter
  end

  class CustomPicture; end
  class CustomAttachmentFile; end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.4.7.4 test/ckeditor_test.rb
glebtv-ckeditor-4.4.7.3 test/ckeditor_test.rb
glebtv-ckeditor-4.4.7.2 test/ckeditor_test.rb
glebtv-ckeditor-4.4.7.1 test/ckeditor_test.rb
glebtv-ckeditor-4.4.7 test/ckeditor_test.rb
glebtv-ckeditor-4.4.6 test/ckeditor_test.rb
glebtv-ckeditor-4.4.3.4 test/ckeditor_test.rb
glebtv-ckeditor-4.4.3.3 test/ckeditor_test.rb
glebtv-ckeditor-4.4.3.2 test/ckeditor_test.rb
glebtv-ckeditor-4.4.3.1 test/ckeditor_test.rb
glebtv-ckeditor-4.4.3.0 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.6 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.5 test/ckeditor_test.rb
ckeditor-4.0.11 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.4 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.3 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.2 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.1 test/ckeditor_test.rb
glebtv-ckeditor-4.3.2.0 test/ckeditor_test.rb
ckeditor-4.0.10 test/ckeditor_test.rb