Sha256: ede448e3f18125f6ed2c64851468b12b30965aa8281d6860d37bdb504867e898

Contents?: true

Size: 1.53 KB

Versions: 30

Compression:

Stored size: 1.53 KB

Contents

require 'test_helper'

class AdminHelperTest < ActiveRecord::TestCase

  def helper
    Class.new(ActionView::Base) do
      include AdminHelper
    end.new
  end

  test "admin_products_path" do
    assert helper.admin_topbar_active?('admin_products_path', 'admin/products')
    refute helper.admin_topbar_active?('admin_products_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_custom_fields_path', 'admin/custom_fields')
    refute helper.admin_topbar_active?('admin_custom_fields_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_product_groups_path', 'admin/product_groups')
    refute helper.admin_topbar_active?('admin_product_groups_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_link_groups_path', 'admin/link_groups')
    refute helper.admin_topbar_active?('admin_link_groups_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_shipping_zones_path', 'admin/shipping_zones')
    assert helper.admin_topbar_active?('admin_shipping_zones_path', 'admin/shipping_methods')
    refute helper.admin_topbar_active?('admin_shipping_zones_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_payment_methods_path', 'admin/payment_methods')
    refute helper.admin_topbar_active?('admin_payment_methods_path', 'admin/orders')

    assert helper.admin_topbar_active?('edit_admin_shop_path', 'admin/shops')
    refute helper.admin_topbar_active?('edit_admin_shop_path', 'admin/orders')

    assert helper.admin_topbar_active?('admin_orders_path', 'admin/orders')
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.23 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.21 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.20 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.19 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.17 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.16 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.15 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.14 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.14.rc2 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.14.rc1 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.13 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.12 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.11 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.10 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.9 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.8 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.7 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.5 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.4.beta1 test/helpers/admin_helper_test.rb
nimbleshop_core-0.0.4 test/helpers/admin_helper_test.rb