/amexsbs/railsapp/vendor/plugins/tab_tab/test/helper_helper_test.rb
Ruby | 41 lines | 30 code | 11 blank | 0 comment | 0 complexity | 9255d10f10500a6f54341e066c6e9b44 MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, MIT
- require File.join(File.dirname(__FILE__), 'test_helper')
- class HelperHelperTest < Test::Unit::TestCase
- def test_tab_name_helper
- view = YeOldeView.new
- view.controller = controller = StuffController.new
- assert_equal 'Home', view.tab_name_helper(:home)
- assert_equal 'Settings', view.tab_name_helper(:account => :settings)
- assert_equal 'User Preferences', view.tab_name_helper(:user_preferences)
- end
- def test_tab_html_attributes_helper
- view = YeOldeView.new
- view.controller = controller = StuffController.new
- assert_equal( { :id => 'stuff_tab', :class => 'active' },
- view.tab_html_attributes_helper(:stuff) )
- assert_equal( { :id => 'not_stuff_tab' },
- view.tab_html_attributes_helper(:not_stuff) )
- assert_equal( { :id => 'x_tab', :class => 'x' },
- view.tab_html_attributes_helper(:x, :class => 'x') )
- assert_equal( { :id => 'stuff_tab', :class => 'active x' },
- view.tab_html_attributes_helper(:stuff, :class => 'x') )
- assert_equal( { :id => 'y', :class => 'active x' },
- view.tab_html_attributes_helper(:stuff, :class => 'x', :id => 'y') )
- end
- def test_tab_activaton_status_helper
- view = YeOldeView.new
- view.controller = controller = StuffController.new
- assert view.tab_activaton_status_helper(:stuff)
- assert !view.tab_activaton_status_helper(:not_stuff)
- end
- end