1802 |
1802 |
assert_include "cf_#{field.id}".to_sym, q.available_totalable_columns.map(&:name)
|
1803 |
1803 |
end
|
1804 |
1804 |
|
|
1805 |
def test_available_totalable_columns_should_sort_in_position_order_for_custom_field
|
|
1806 |
ProjectCustomField.delete_all
|
|
1807 |
cf_pos3 = ProjectCustomField.generate!(:position => 3, :is_for_all => true, :field_format => 'int')
|
|
1808 |
cf_pos4 = ProjectCustomField.generate!(:position => 4, :is_for_all => true, :field_format => 'float')
|
|
1809 |
cf_pos1 = ProjectCustomField.generate!(:position => 1, :is_for_all => true, :field_format => 'float')
|
|
1810 |
cf_pos2 = ProjectCustomField.generate!(:position => 2, :is_for_all => true, :field_format => 'int')
|
|
1811 |
q = ProjectQuery.new
|
|
1812 |
custom_field_columns = q.available_totalable_columns.select{|column| column.is_a?(QueryCustomFieldColumn)}
|
|
1813 |
assert_equal [cf_pos1, cf_pos2, cf_pos3, cf_pos4], custom_field_columns.collect(&:custom_field)
|
|
1814 |
|
|
1815 |
q = TimeEntryQuery.new
|
|
1816 |
custom_field_columns = q.available_totalable_columns.select{|column| column.is_a?(QueryCustomFieldColumn)}
|
|
1817 |
assert_equal [cf_pos1, cf_pos2, cf_pos3, cf_pos4], custom_field_columns.collect(&:custom_field)
|
|
1818 |
|
|
1819 |
IssueCustomField.delete_all
|
|
1820 |
cf_pos3 = IssueCustomField.generate!(:position => 3, :is_for_all => true, :field_format => 'int')
|
|
1821 |
cf_pos4 = IssueCustomField.generate!(:position => 4, :is_for_all => true, :field_format => 'float')
|
|
1822 |
cf_pos1 = IssueCustomField.generate!(:position => 1, :is_for_all => true, :field_format => 'float')
|
|
1823 |
cf_pos2 = IssueCustomField.generate!(:position => 2, :is_for_all => true, :field_format => 'int')
|
|
1824 |
q = IssueQuery.new
|
|
1825 |
custom_field_columns = q.available_totalable_columns.select{|column| column.is_a?(QueryCustomFieldColumn)}
|
|
1826 |
assert_equal [cf_pos1, cf_pos2, cf_pos3, cf_pos4], custom_field_columns.collect(&:custom_field)
|
|
1827 |
end
|
|
1828 |
|
1805 |
1829 |
def test_total_for_estimated_hours
|
1806 |
1830 |
Issue.delete_all
|
1807 |
1831 |
Issue.generate!(:estimated_hours => 5.5)
|