Sha256: 745505f7b3d2759a589182742ef1fb39da63cea9d6b8cd601386a28af597d3d5

Contents?: true

Size: 790 Bytes

Versions: 7

Compression:

Stored size: 790 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'
require File.dirname(__FILE__) + '/../fixture_setup'

# 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 Article < ActiveRecord::Base
  auto_html_for :body do
    simple_format
  end
end

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

  def test_transform_after_save
    @article = Article.new(:body => 'Yo!')
    @article.save!
    assert_equal '<p>Yo!</p>', @article.body_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 & 3 rubygems

Version Path
dejan-auto_html-1.1.0 test/functional/auto_html_for_options_test.rb
dejan-auto_html-1.1.1 test/functional/auto_html_for_options_test.rb
dejan-auto_html-1.1.2 test/functional/auto_html_for_options_test.rb
dejan-auto_html-1.2.0 test/functional/auto_html_for_options_test.rb
galetahub-auto_html-1.0.1 test/functional/auto_html_for_options_test.rb
auto_html-1.2.1 test/functional/auto_html_for_options_test.rb
auto_html-1.2.0 test/functional/auto_html_for_options_test.rb