Sha256: 2ace5a50834a4595ca2bcbf0e8cf82c8ea60159e3265dc316ded1c4ba216c2c5

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

require File.join(File.dirname(__FILE__), '/../../test_helper')

class Cms::DynamicViewHelperTest < ActionView::TestCase
  
  context "view_content_button_css_class helper" do
    should "return 'button off' when action is 'version'" do
      @controller.stubs(:action_name).returns('version')
      assert_equal 'button off', view_content_button_css_class
    end
    
    should "return 'button off' when action is 'show'" do
      @controller.stubs(:action_name).returns('show')
      assert_equal 'button off', view_content_button_css_class
    end

    should "return 'button disabled' when action is index" do
      @controller.stubs(:action_name).returns('index')
      assert_equal 'button disabled', view_content_button_css_class
    end
  end
  
  context "versions_button_css_class helper" do
    should "return 'button off' when action is 'versions'" do
      @controller.stubs(:action_name).returns('versions')
      assert_equal 'button off', versions_button_css_class
    end

    should "return 'button' when action is 'version'" do
      @controller.stubs(:action_name).returns('version')
      assert_equal 'button', versions_button_css_class
    end
    
    should "return 'button' when action is 'show'" do
      @controller.stubs(:action_name).returns('show')
      assert_equal 'button', versions_button_css_class
    end
        
    should "return 'button disabled' when action is index" do
      @controller.stubs(:action_name).returns('index')
      assert_equal 'button disabled', versions_button_css_class
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
webficient-browsercms-3.0.1 test/unit/helpers/dynamic_view_helper_test.rb
webficient-browsercms-3.0.2 test/unit/helpers/dynamic_view_helper_test.rb
webficient-browsercms-3.0.3 test/unit/helpers/dynamic_view_helper_test.rb
webficient-browsercms-3.0.4 test/unit/helpers/dynamic_view_helper_test.rb