Sha256: b4129338248a0531fbf8721e6bb977d948eb27f623472b1a7cb5bcc2bc970f15

Contents?: true

Size: 1.5 KB

Versions: 5

Compression:

Stored size: 1.5 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?('/javascripts/ckeditor/ckeditor.js')
    assert page.body.include?("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?("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?("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?("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

5 entries across 5 versions & 1 rubygems

Version Path
ckeditor-3.6.3 test/integration/posts_test.rb
ckeditor-3.6.2 test/integration/posts_test.rb
ckeditor-3.6.1 test/integration/posts_test.rb
ckeditor-3.6.0 test/integration/posts_test.rb
ckeditor-3.6.0.pre test/integration/posts_test.rb