Sha256: 767b46756198a9eeb17a2cfc4c96f6a4a7ac9bbd1edbc01d3e99645efa9393c3

Contents?: true

Size: 620 Bytes

Versions: 3

Compression:

Stored size: 620 Bytes

Contents

require 'test_helper'

module PushType
  class WysiwygFieldTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :foo, :wysiwyg, toolbar: 'text'
    end

    let(:node)  { TestPage.create FactoryBot.attributes_for(:node, foo: val) }
    let(:val)   { 'abc' }
    let(:field) { node.fields[:foo] }
    
    it { field.form_helper.must_equal :text_area }
    it { field.toolbar.must_equal 'text' }
    it { field.html_options[:'froala-toolbar'].must_equal 'text' }
    it { field.json_value.must_equal val }
    it { field.value.must_equal val }

    it { node.foo.must_equal val }
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_type_core-0.12.1 test/fields/push_type/wysiwyg_field_test.rb
push_type_core-0.12.0 test/fields/push_type/wysiwyg_field_test.rb
push_type_core-0.12.0.beta.1 test/fields/push_type/wysiwyg_field_test.rb