[#2279] Populated the Timesheet filter with the values from the Billable field

using the OverheadHelper.
This commit is contained in:
Eric Davis
2009-04-22 12:02:30 -07:00
parent 92792f300b
commit 9ee8c41d7b
3 changed files with 21 additions and 2 deletions

View File

@@ -63,5 +63,19 @@ describe OverheadTimesheetHook, "#plugin_timesheet_views_timesheet_form", :type
response.should have_tag('select[name=?][multiple=multiple]', 'timesheet[billable][]')
end
it 'should populate the select field with the possible options of the custom data field' do
@custom_field = mock_model(TimeEntryActivityCustomField,
:possible_values => ['A','B','Nil'],
:field_format => 'list')
TimeEntryActivity.should_receive(:billable_custom_field).and_return(@custom_field)
response = call_hook(:plugin_timesheet_views_timesheet_form, {})
response.should have_tag('select') do
with_tag('option[value=?]','A','A')
with_tag('option[value=?]','B','B')
with_tag('option[value=?]','Nil','none')
end
end
it 'should pre-select the values from the submission'
end