Revert "TEMP: Remove override for no-longer-present method"

This reverts commit a3b91dabe5.

Conflicts:
	app/helpers/spree/admin/navigation_helper_decorator.rb
This commit is contained in:
Maikel Linke
2016-11-30 16:53:35 +11:00
committed by Rohan Mitchell
parent 3a69c958ef
commit a2a6ce1b3e
2 changed files with 22 additions and 22 deletions

View File

@@ -13,14 +13,14 @@ module Spree
# Make it so that the Reports admin tab can be enabled/disabled through the cancan
# :report resource, since it does not have a corresponding resource class (unlike
# eg. Spree::Product).
# def klass_for_with_sym_fallback(name)
# klass = klass_for_without_sym_fallback(name)
# klass ||= name.singularize.to_sym
# klass = :overview if klass == :dashboard
# klass = Spree::Order if klass == :bulk_order_management
# klass
# end
# alias_method_chain :klass_for, :sym_fallback
def klass_for_with_sym_fallback(name)
klass = klass_for_without_sym_fallback(name)
klass ||= name.singularize.to_sym
klass = :overview if klass == :dashboard
klass = Spree::Order if klass == :bulk_order_management
klass
end
alias_method_chain :klass_for, :sym_fallback
# TEMP: override method until it is fixed in Spree.
def tab_with_cancan_check(*args)

View File

@@ -3,23 +3,23 @@ require 'spec_helper'
module Spree
module Admin
describe NavigationHelper do
# describe "klass_for" do
# it "returns the class when present" do
# helper.klass_for('products').should == Spree::Product
# end
describe "klass_for" do
it "returns the class when present" do
helper.klass_for('products').should == Spree::Product
end
# it "returns a symbol when there's no available class" do
# helper.klass_for('reports').should == :report
# end
it "returns a symbol when there's no available class" do
helper.klass_for('reports').should == :report
end
# it "returns :overview for the dashboard" do
# helper.klass_for('dashboard').should == :overview
# end
it "returns :overview for the dashboard" do
helper.klass_for('dashboard').should == :overview
end
# it "returns Spree::Order for bulk_order_management" do
# helper.klass_for('bulk_order_management').should == Spree::Order
# end
# end
it "returns Spree::Order for bulk_order_management" do
helper.klass_for('bulk_order_management').should == Spree::Order
end
end
end
end
end