Sha256: 600d88c965994352e5d89d89e416ff841ec76a82289648c3006d1382ce5ace04

Contents?: true

Size: 1.51 KB

Versions: 3

Compression:

Stored size: 1.51 KB

Contents

require 'test_helper'

class PostsTest < ActiveSupport::IntegrationCase
  def setup
    @post = Post.create!(:title => "test", :content => "content", :info => "info")
  end
  
  def teardown
    @post.destroy
  end
  
  test "include javascripts" do
    visit(posts_path)
    
    assert page.body.include?('/assets/application.js')
    assert page.body.include?(%q{CKEDITOR.replace('test_area', { "language": 'en' });})
  end
  
  test "pass text_area with options" do
    visit(posts_path)
    
    assert page.body.include?('<textarea cols="10" id="content" name="content" rows="20">Ckeditor</textarea>')
    assert page.body.include?(%q{CKEDITOR.replace('content', { "language": 'en',"toolbar": 'Easy' });})
  end
  
  test "form builder helper" do
    visit(new_post_path)
    
    assert page.body.include?('<textarea cols="40" id="post_content" name="post[content]" rows="20"></textarea>')
    assert page.body.include?(%q{CKEDITOR.replace('post_content', { "height": 400,"language": 'en',"width": 800 });})
    assert page.body.include?('<textarea cols="40" id="post_info" name="post[info]" rows="20">Defaults info content</textarea>')
    assert page.body.include?(%q{CKEDITOR.replace('post_info', { "language": 'en' });})
  end
  
  test "text_area value" do
    visit(edit_post_path(@post))
    
    assert page.body.include?('<textarea cols="40" id="post_content" name="post[content]" rows="20">content</textarea>')
    assert page.body.include?('<textarea cols="50" id="post_info" name="post[info]" rows="70">info</textarea>')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ckeditor-3.7.0.rc3 test/integration/posts_test.rb
ckeditor-3.7.0.rc2 test/integration/posts_test.rb
ckeditor-3.7.0.rc1 test/integration/posts_test.rb