[#4289] Added empty hooks needed for the Timesheet.

This commit is contained in:
Eric Davis
2010-07-23 09:35:44 -07:00
parent a341be0344
commit 7192adb231
9 changed files with 145 additions and 0 deletions

View File

@@ -30,3 +30,8 @@ Redmine::Plugin.register :redmine_rate do
permission :view_rate, { } permission :view_rate, { }
end 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'

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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