Sha256: f8f397d1ede61b8861ffe3c73c0241c6059888bea5a1b811a95284bcb9376ded

Contents?: true

Size: 1.48 KB

Versions: 22

Compression:

Stored size: 1.48 KB

Contents

require File.dirname(__FILE__) + '/../abstract_unit'

class DeprecatedHelperTest < Test::Unit::TestCase
  include ActionView::Helpers::JavaScriptHelper
  include ActionView::Helpers::CaptureHelper
  
  def test_update_element_function
    assert_deprecated 'update_element_function' do
      
      assert_equal %($('myelement').innerHTML = 'blub';\n),
        update_element_function('myelement', :content => 'blub')
      assert_equal %($('myelement').innerHTML = 'blub';\n),
        update_element_function('myelement', :action => :update, :content => 'blub')
      assert_equal %($('myelement').innerHTML = '';\n),
        update_element_function('myelement', :action => :empty)
      assert_equal %(Element.remove('myelement');\n),
        update_element_function('myelement', :action => :remove)
        
      assert_equal %(new Insertion.Bottom('myelement','blub');\n),
        update_element_function('myelement', :position => 'bottom', :content => 'blub')
      assert_equal %(new Insertion.Bottom('myelement','blub');\n),
        update_element_function('myelement', :action => :update, :position => :bottom, :content => 'blub')
        
      _erbout = ""
      assert_equal %($('myelement').innerHTML = 'test';\n),
        update_element_function('myelement') { _erbout << "test" }
        
      _erbout = ""
      assert_equal %($('myelement').innerHTML = 'blockstuff';\n),
        update_element_function('myelement', :content => 'paramstuff') { _erbout << "blockstuff" }
      
    end
  end

end

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/actionpack/test/template/deprecated_helper_test.rb
actionpack-1.13.0 test/template/deprecated_helper_test.rb
actionpack-1.13.3 test/template/deprecated_helper_test.rb
actionpack-1.13.6 test/template/deprecated_helper_test.rb
actionpack-1.13.2 test/template/deprecated_helper_test.rb
actionpack-1.13.1 test/template/deprecated_helper_test.rb
actionpack-1.13.4 test/template/deprecated_helper_test.rb
actionpack-1.13.5 test/template/deprecated_helper_test.rb
radiant-0.6.0 vendor/rails/actionpack/test/template/deprecated_helper_test.rb
radiant-0.6.1 vendor/rails/actionpack/test/template/deprecated_helper_test.rb
radiant-0.6.2 vendor/rails/actionpack/test/template/deprecated_helper_test.rb
radiant-0.6.3 vendor/rails/actionpack/test/template/deprecated_helper_test.rb
radiant-0.6.4 vendor/rails/actionpack/test/template/deprecated_helper_test.rb