[#4289] Added empty hooks needed for the Timesheet.
This commit is contained in:
5
init.rb
5
init.rb
@@ -30,3 +30,8 @@ Redmine::Plugin.register :redmine_rate do
|
||||
|
||||
permission :view_rate, { }
|
||||
end
|
||||
|
||||
require 'redmine_rate/hooks/plugin_timesheet_views_timesheets_time_entry_row_class_hook'
|
||||
require 'redmine_rate/hooks/plugin_timesheet_views_timesheet_group_header_hook'
|
||||
require 'redmine_rate/hooks/plugin_timesheet_views_timesheet_time_entry_hook'
|
||||
require 'redmine_rate/hooks/plugin_timesheet_views_timesheet_time_entry_sum_hook'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
module RedmineRate
|
||||
module Hooks
|
||||
class PluginTimesheetViewsTimesheetGroupHeaderHook < Redmine::Hook::ViewListener
|
||||
def plugin_timesheet_views_timesheet_group_header(context={})
|
||||
return ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RedmineRate
|
||||
module Hooks
|
||||
class PluginTimesheetViewsTimesheetTimeEntryHook < Redmine::Hook::ViewListener
|
||||
def plugin_timesheet_views_timesheet_time_entry(context={})
|
||||
return ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RedmineRate
|
||||
module Hooks
|
||||
class PluginTimesheetViewsTimesheetTimeEntrySumHook < Redmine::Hook::ViewListener
|
||||
def plugin_timesheet_views_timesheet_time_entry_sum(context={})
|
||||
return ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RedmineRate
|
||||
module Hooks
|
||||
class PluginTimesheetViewsTimesheetsTimeEntryRowClassHook < Redmine::Hook::ViewListener
|
||||
def plugin_timesheet_views_timesheets_time_entry_row_class(context={})
|
||||
return ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
require File.dirname(__FILE__) + '/../../../../test_helper'
|
||||
|
||||
class RedmineRate::Hooks::PluginTimesheetViewsTimesheetGroupHeaderTest < ActionController::TestCase
|
||||
include Redmine::Hook::Helper
|
||||
|
||||
def controller
|
||||
@controller ||= ApplicationController.new
|
||||
@controller.response ||= ActionController::TestResponse.new
|
||||
@controller
|
||||
end
|
||||
|
||||
def request
|
||||
@request ||= ActionController::TestRequest.new
|
||||
end
|
||||
|
||||
def hook(args={})
|
||||
call_hook :plugin_timesheet_views_timesheet_group_header, args
|
||||
end
|
||||
|
||||
context "#plugin_timesheet_views_timesheet_group_header" do
|
||||
should "return an empty string" do
|
||||
@response.body = hook
|
||||
assert @response.body.blank?
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
require File.dirname(__FILE__) + '/../../../../test_helper'
|
||||
|
||||
class RedmineRate::Hooks::PluginTimesheetViewsTimesheetTimeEntryTest < ActionController::TestCase
|
||||
include Redmine::Hook::Helper
|
||||
|
||||
def controller
|
||||
@controller ||= ApplicationController.new
|
||||
@controller.response ||= ActionController::TestResponse.new
|
||||
@controller
|
||||
end
|
||||
|
||||
def request
|
||||
@request ||= ActionController::TestRequest.new
|
||||
end
|
||||
|
||||
def hook(args={})
|
||||
call_hook :plugin_timesheet_views_timesheet_time_entry, args
|
||||
end
|
||||
|
||||
context "#plugin_timesheet_views_timesheet_time_entry" do
|
||||
should "return an empty string" do
|
||||
@response.body = hook
|
||||
assert @response.body.blank?
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
require File.dirname(__FILE__) + '/../../../../test_helper'
|
||||
|
||||
class RedmineRate::Hooks::PluginTimesheetViewsTimesheetTimeEntrySumTest < ActionController::TestCase
|
||||
include Redmine::Hook::Helper
|
||||
|
||||
def controller
|
||||
@controller ||= ApplicationController.new
|
||||
@controller.response ||= ActionController::TestResponse.new
|
||||
@controller
|
||||
end
|
||||
|
||||
def request
|
||||
@request ||= ActionController::TestRequest.new
|
||||
end
|
||||
|
||||
def hook(args={})
|
||||
call_hook :plugin_timesheet_views_timesheet_time_entry_sum, args
|
||||
end
|
||||
|
||||
context "#plugin_timesheet_views_timesheet_time_entry_sum" do
|
||||
should "return an empty string" do
|
||||
@response.body = hook
|
||||
assert @response.body.blank?
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
require File.dirname(__FILE__) + '/../../../../test_helper'
|
||||
|
||||
class RedmineRate::Hooks::PluginTimesheetViewsTimesheetsTimeEntryRowClassTest < ActionController::TestCase
|
||||
include Redmine::Hook::Helper
|
||||
|
||||
def controller
|
||||
@controller ||= ApplicationController.new
|
||||
@controller.response ||= ActionController::TestResponse.new
|
||||
@controller
|
||||
end
|
||||
|
||||
def request
|
||||
@request ||= ActionController::TestRequest.new
|
||||
end
|
||||
|
||||
def hook(args={})
|
||||
call_hook :plugin_timesheet_views_timesheets_time_entry_row_class, args
|
||||
end
|
||||
|
||||
context "#plugin_timesheet_views_timesheets_time_entry_row_class" do
|
||||
should "return an empty string" do
|
||||
@response.body = hook
|
||||
assert @response.body.blank?
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user