[#2847] Created a very basic set of hooks for the Deliverables table in the Budget plugin.

This commit is contained in:
Eric Davis
2009-08-05 13:45:36 -07:00
parent ea1c466134
commit 47869780a6
3 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
require File.dirname(__FILE__) + '/../spec_helper'
# Hack to make RSpec play nicely with call_hook's default contexts
def stub_view_to_use_controller_instance
self.stub!(:controller).and_return(@controller)
end
describe OverheadBudgetHook, "#plugin_budget_view_deliverable_list_header", :type => :view do
include Redmine::Hook::Helper
before(:each) do
stub_view_to_use_controller_instance
end
end
describe OverheadBudgetHook, "#plugin_budget_view_deliverable_summary_row", :type => :view do
include Redmine::Hook::Helper
before(:each) do
stub_view_to_use_controller_instance
end
end
describe OverheadBudgetHook, "#plugin_budget_view_deliverable_details_row", :type => :view do
include Redmine::Hook::Helper
before(:each) do
stub_view_to_use_controller_instance
end
it 'should return an empty table cell to align the table' do
call_hook(:plugin_budget_view_deliverable_details_row, {}).should have_tag('td','')
end
end
describe OverheadBudgetHook, "#plugin_budget_view_deliverable_description_row", :type => :view do
include Redmine::Hook::Helper
before(:each) do
stub_view_to_use_controller_instance
end
it 'should return an empty table cell to align the table' do
call_hook(:plugin_budget_view_deliverable_description_row, {}).should have_tag('td','')
end
end