Sha256: 2a2bc8bd8aed47cd584c1a62a19a911dcbb69d440097cf10c3064f267ead94c3

Contents?: true

Size: 860 Bytes

Versions: 4

Compression:

Stored size: 860 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe CKEditor5::Rails::Editor::PropsPlugin do
  describe '#to_h' do
    it 'generates string for standard plugin' do
      plugin = described_class.new(:Bold)
      expect(plugin.to_h).to eq('Bold')
    end

    it 'generates hash for premium plugin' do
      plugin = described_class.new(:Bold, premium: true)
      expect(plugin.to_h).to include(
        import_name: 'ckeditor5-premium-features',
        import_as: :Bold
      )
    end

    it 'handles custom import metadata' do
      plugin = described_class.new(:Custom,
                                   import_name: 'custom-module',
                                   window_name: 'CustomPlugin')
      expect(plugin.to_h).to include(
        import_name: 'custom-module',
        window_name: 'CustomPlugin'
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/ckeditor5-1.24.9/spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb
ckeditor5-1.24.9 spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb
ckeditor5-1.24.8 spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb
ckeditor5-1.24.6 spec/lib/ckeditor5/rails/editor/props_plugin_spec.rb