Sha256: fba1ad6d9415cd02de5f66931b255babb6f4fbf417fdf6213a400cc4c9cd657b

Contents?: true

Size: 867 Bytes

Versions: 7

Compression:

Stored size: 867 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)
require File.expand_path('../../fixture_setup', __FILE__)

# store default so we can revert so that other tests use default option
default_suffix = AutoHtmlFor.auto_html_for_options[:htmlized_attribute_suffix]
AutoHtmlFor.auto_html_for_options[:htmlized_attribute_suffix] = '_htmlized'

class Post < ActiveRecord::Base
  auto_html_for :content do
    simple_format
  end
end

class AutoHtmlForOptionsTest < Test::Unit::TestCase
  include FixtureSetup

  def test_transform_after_save
    @article = Post.new(:content => 'Yo!')
    assert_equal '<p>Yo!</p>', @article.content_htmlized
    @article.save!
    assert_equal '<p>Yo!</p>', @article.content_htmlized
  end
end

# reverting to default so that other tests use default option
AutoHtmlFor.auto_html_for_options[:htmlized_attribute_suffix] = default_suffix

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
auto_html-1.6.4 test/functional/auto_html_for_options_test.rb
auto_html-1.6.3 test/functional/auto_html_for_options_test.rb
auto_html-1.6.2 test/functional/auto_html_for_options_test.rb
auto_html-1.6.1 test/functional/auto_html_for_options_test.rb
auto_html-1.6.0 test/functional/auto_html_for_options_test.rb
auto_html-1.5.3 test/functional/auto_html_for_options_test.rb
auto_html-1.5.2 test/functional/auto_html_for_options_test.rb