Displaying 1 result from an estimated 1 matches for "managementcontrol".
2007 Oct 16
3
Controller iterating through returned records and appending to each
...employees = Employee.find_active_employees
@employees.each { |e| e.current_goal = e.billablegoals.empty? ? "-" :
e.billablegoals.select { |bg| bg.effective_date <= Date.today }[0].goal }
end
Spec:
require File.dirname(__FILE__) + ''/../spec_helper.rb''
describe ManagementController, "GET /management/employee_report" do
before(:each) do
@bg1 = mock_model(Billablegoal, :effective_date => Date.today-3.months,
:goal => 50)
@bg2 = mock_model(Billablegoal, :effective_date => Date.today + 1.month,
:goal => 75)
@mock_employee = mock_model(Emplo...