fixed Formatter key

which should be the first word of the Formatter's
simple class name (e.g. :cost for CostFormatter)
pull/6827/head
Markus Kahl 11 years ago
parent c3389212dd
commit ed583639ce
  1. 2
      lib/open_project/xls_export/formatters.rb
  2. 4
      spec/patches/work_packages_controller_patch_spec.rb

@ -31,7 +31,7 @@ module OpenProject::XlsExport
end
def self.key
name = self.name.underscore
name = self.name.demodulize.underscore
name[0..(name.index("_") - 1)].to_sym
end

@ -60,6 +60,10 @@ describe WorkPackagesController, "rendering to xls", :type => :controller do
column.caption =~ /time/i
end
OpenProject::XlsExport::Formatters::CostFormatter.stub(:apply?) do |column|
column.caption =~ /cost/i
end
get 'index',
:format => 'xls',
:project_id => work_packages.first.project_id,

Loading…
Cancel
Save