Sha256: b3e6ef7984ce94de6ab03d10919d1829c827dec77cc847ba9901cfa25356593a

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 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 < Minitest::Test
  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

1 entries across 1 versions & 1 rubygems

Version Path
auto_html-whistlerbrk-2.0.0.pre test/functional/auto_html_for_options_test.rb