Sha256: 6a601ee3479dc45bd79fb9e18e5a95cb2656feeb89eb014d036c04c27e05cc5c

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

require 'test_helper'

class TinyMceTest < ActionView::TestCase
  include ActiveScaffold::Helpers::ViewHelpers
  include ActiveScaffold::Bridges::TinyMce::Helpers

  def test_includes
    ActiveScaffold::Bridges::TinyMce.expects(:install?).returns(true)
    ActiveScaffold.js_framework = :jquery
    assert ActiveScaffold::Bridges.all_javascripts.include?('tinymce-jquery')
  end

  def test_form_ui
    config = ActiveScaffold::Config::Core.new(:company)
    record = Company.new
    expects(:request).returns(stub(:xhr? => true))

    assert_dom_equal %{<textarea name=\"record[name]\" class=\"name-input mceEditor\" id=\"record_name\">\n</textarea>\n<script#{' type="text/javascript"' if Rails::VERSION::MAJOR < 4}>\n//<![CDATA[\ntinyMCE.settings = {\"theme\":\"modern\"};tinyMCE.execCommand('mceAddEditor', false, 'record_name');\n//]]>\n</script>}, active_scaffold_input_text_editor(config.columns[:name], :name => 'record[name]', :id => 'record_name', :class => 'name-input', :object => record)
  end

  protected

  def include_tiny_mce_if_needed; end

  def tiny_mce_js; end

  def using_tiny_mce?
    true
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
active_scaffold-3.4.36 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.35 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.34 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.33 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.32 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.31 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.30 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.29 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.28 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.27 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.26 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.25 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.24 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.23 test/bridges/tiny_mce_test.rb
active_scaffold-3.4.22 test/bridges/tiny_mce_test.rb