[#4225] Generated a hook for the timelog available criterias.
This commit is contained in:
1
init.rb
1
init.rb
@@ -45,3 +45,4 @@ Redmine::Plugin.register :budget_plugin do
|
|||||||
|
|
||||||
menu :project_menu, :budget, {:controller => "deliverables", :action => 'index'}, :caption => :budget_title
|
menu :project_menu, :budget, {:controller => "deliverables", :action => 'index'}, :caption => :budget_title
|
||||||
end
|
end
|
||||||
|
require 'redmine_budget/hooks/controller_timelog_available_criterias_hook'
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
module RedmineBudget
|
||||||
|
module Hooks
|
||||||
|
class ControllerTimelogAvailableCriteriasHook < Redmine::Hook::ViewListener
|
||||||
|
def controller_timelog_available_criterias(context={})
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
require File.dirname(__FILE__) + '/../spec_helper'
|
||||||
|
|
||||||
|
include Redmine::Hook::Helper
|
||||||
|
|
||||||
|
def controller
|
||||||
|
@controller ||= TimelogController.new
|
||||||
|
@controller.response ||= ActionController::TestResponse.new
|
||||||
|
@controller
|
||||||
|
end
|
||||||
|
|
||||||
|
def request
|
||||||
|
@request ||= ActionController::TestRequest.new
|
||||||
|
end
|
||||||
|
|
||||||
|
describe TimelogController, '#controller_timelog_available_criterias_hook', :type => :controller do
|
||||||
|
it 'should return an empty string' do
|
||||||
|
call_hook(:controller_timelog_available_criterias, {}).should be_blank
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user