Defect #33273 » 33273_4.0.8.patch
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
def total_tag(column, value)
|
||
|
label = content_tag('span', "#{column.caption}:")
|
||
|
value = if [:hours, :spent_hours, :total_spent_hours, :estimated_hours].include? column.name
|
||
|
value = if [:hours, :spent_hours, :total_spent_hours, :estimated_hours, :total_estimated_hours].include? column.name
|
||
|
format_hours(value)
|
||
|
else
|
||
|
format_object(value)
|
||
| ... | ... | |
|
content_tag('span',
|
||
|
value.to_s(item) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe,
|
||
|
:class => value.css_classes_for(item))
|
||
|
when :hours, :estimated_hours
|
||
|
when :hours, :estimated_hours, :total_estimated_hours
|
||
|
format_hours(value)
|
||
|
when :spent_hours
|
||
|
link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_index_should_respect_timespan_format
|
||
|
with_settings :timespan_format => 'minutes' do
|
||
|
get(
|
||
|
:index,
|
||
|
:params => {
|
||
|
:set_filter => 1,
|
||
|
:c => %w(estimated_hours total_estimated_hours spent_hours total_spent_hours)
|
||
|
}
|
||
|
)
|
||
|
assert_select 'table.issues tr#issue-1 td.estimated_hours', :text => '200:00'
|
||
|
assert_select 'table.issues tr#issue-1 td.total_estimated_hours', :text => '200:00'
|
||
|
assert_select 'table.issues tr#issue-1 td.spent_hours', :text => '154:15'
|
||
|
assert_select 'table.issues tr#issue-1 td.total_spent_hours', :text => '154:15'
|
||
|
end
|
||
|
end
|
||
|
def test_show_by_anonymous
|
||
|
get :show, :params => {
|
||
|
:id => 1
|
||
| ... | ... | |
|
with_settings :date_format => '%d/%m/%Y' do
|
||
|
issue = Issue.generate!(:start_date => '2018-11-29', :due_date => '2018-12-01')
|
||
|
IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => issue, :relation_type => 'relates')
|
||
|
|
||
|
get :show, :params => {
|
||
|
:id => 1
|
||
|
}
|
||
|
assert_response :success
|
||
|
|
||
|
assert_select '#relations td.start_date', :text => '29/11/2018'
|
||
|
assert_select '#relations td.due_date', :text => '01/12/2018'
|
||
|
end
|
||
- « Previous
- 1
- 2
- Next »