Sha256: 0b1c772196d0a09a4b6b22d67c6652d4c61ea4469abf8e3db94f30f1f4f0ff80

Contents?: true

Size: 1.36 KB

Versions: 24

Compression:

Stored size: 1.36 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#content[name=content][cols=10][rows=20]", "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#post_content[name='post[content]'][cols=40][rows=20]", ""
    assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('post_content', {"width":800,"height":400});!))
    assert_select "textarea#new_info_content[name='post[info]'][cols=40][rows=20]", "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#post_content[name='post[content]'][cols=40][rows=20]", "content"
    assert_select "textarea#post_info[name='post[info]'][cols=50][rows=70]", "info"
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
ckeditor-4.1.3 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.7.4 test/functional/posts_controller_test.rb
ckeditor-4.1.2 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.7.3 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.7.2 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.7.1 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.7 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.6 test/functional/posts_controller_test.rb
ckeditor-4.1.1 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.3.4 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.3.3 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.3.2 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.3.1 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.4.3.0 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.3.2.6 test/functional/posts_controller_test.rb
ckeditor-4.1.0 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.3.2.5 test/functional/posts_controller_test.rb
ckeditor-4.0.11 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.3.2.4 test/functional/posts_controller_test.rb
glebtv-ckeditor-4.3.2.3 test/functional/posts_controller_test.rb