[#4182] Refactor duplicated test setup to helper.

This commit is contained in:
Eric Davis
2010-07-07 13:26:50 -07:00
parent b8edb5b4fc
commit 9da37a6cfd
2 changed files with 30 additions and 45 deletions
+28
View File
@@ -81,3 +81,31 @@ end
class ActionController::IntegrationTest
include IntegrationTestHelper
end
class ActiveSupport::TestCase
def configure_overhead_plugin
@custom_field = TimeEntryActivityCustomField.generate!
Setting['plugin_redmine_overhead'] = {
'custom_field' => @custom_field.id.to_s,
'billable_value' => "true",
'overhead_value' => "false"
}
@billable_activity = TimeEntryActivity.generate!.reload
@billable_activity.custom_field_values = {
@custom_field.id => 'true'
}
assert @billable_activity.save
assert @billable_activity.billable?
@non_billable_activity = TimeEntryActivity.generate!.reload
@non_billable_activity.custom_field_values = {
@custom_field.id => 'false'
}
assert @non_billable_activity.save
assert !@non_billable_activity.billable?
end
end