mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Adds issue custom fields to time entries filters (#10191).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11171 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -519,6 +519,15 @@ class TimelogControllerTest < ActionController::TestCase
|
||||
assert_equal [t3, t1, t2], assigns(:entries)
|
||||
end
|
||||
|
||||
def test_index_with_filter_on_issue_custom_field
|
||||
issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {2 => 'filter_on_issue_custom_field'})
|
||||
entry = TimeEntry.generate!(:issue => issue, :hours => 2.5)
|
||||
|
||||
get :index, :f => ['issue.cf_2'], :op => {'issue.cf_2' => '='}, :v => {'issue.cf_2' => ['filter_on_issue_custom_field']}
|
||||
assert_response :success
|
||||
assert_equal [entry], assigns(:entries)
|
||||
end
|
||||
|
||||
def test_index_atom_feed
|
||||
get :index, :project_id => 1, :format => 'atom'
|
||||
assert_response :success
|
||||
|
||||
@@ -98,6 +98,17 @@ module ObjectHelpers
|
||||
version
|
||||
end
|
||||
|
||||
def TimeEntry.generate!(attributes={})
|
||||
entry = TimeEntry.new(attributes)
|
||||
entry.user ||= User.find(2)
|
||||
entry.issue ||= Issue.find(1)
|
||||
entry.project ||= entry.issue.project
|
||||
entry.activity ||= TimeEntryActivity.first
|
||||
entry.spent_on ||= Date.today
|
||||
entry.save!
|
||||
entry
|
||||
end
|
||||
|
||||
def AuthSource.generate!(attributes={})
|
||||
@generated_auth_source_name ||= 'Auth 0'
|
||||
@generated_auth_source_name.succ!
|
||||
|
||||
Reference in New Issue
Block a user