Sha256: 4a067fe86a6e514ff283863468f380ceb8ac7db2ba31334f7e1348b1b169bfb6

Contents?: true

Size: 1.22 KB

Versions: 11

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

class PostsControllerTest < ActionController::TestCase
  def setup
    @post = Post.create!(:title => "test", :content => "content", :info => "info")
  end

  def teardown
    @post.destroy rescue nil
  end

  test "include javascripts" do
    get :index

    assert_select "script[src='/assets/application.js']"
    assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('test_area');!))
  end

  test "pass text_area with options" do
    get :index

    assert_select "textarea[name='content']", "Ckeditor"
    assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('content', {"toolbar":"Easy"});!))
  end

  test "form builder helper" do
    get :new

    assert_select "textarea[name='post[content]']", ""
    assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('post_content', {"width":800,"height":400});!))
    assert_select "textarea[name='post[info]']", "Defaults info content"
    assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('new_info_content');!))
  end

  test "text_area value" do
    get :edit, :id => @post.id

    assert_select "textarea[name='post[content]']", "content"
    assert_select "textarea[name='post[info]']", "info"
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
danabr75-ckeditor-4.1.6 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.6.0 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.5.10.3 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.5.10.2 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.5.10.1 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.5.7.1 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.5.7 test/functional/posts_controller_test.rb
ckeditor_custom_controller-4.1.6 test/functional/posts_controller_test.rb
ckeditor-4.1.6 test/functional/posts_controller_test.rb
ckeditor-4.1.5 test/functional/posts_controller_test.rb
ckeditor-4.1.4 test/functional/posts_controller_test.rb