Project

General

Profile

Defect #31779 ยป 31779_add_test.patch

Yuichi HARADA, 2019-09-18 06:58

View differences:

test/unit/query_test.rb
2061 2061
    end
2062 2062
  end
2063 2063

  
2064
  def test_available_columns_should_not_include_total_estimated_hours_when_trackers_disabled_estimated_hours
2065
    Tracker.visible.each do |tracker|
2066
      tracker.core_fields = tracker.core_fields.reject{|field| field == 'estimated_hours'}
2067
      tracker.save!
2068
    end
2069
    query = IssueQuery.new
2070
    available_columns = query.available_columns.map(&:name)
2071
    assert_not_include :estimated_hours, available_columns
2072
    assert_not_include :total_estimated_hours, available_columns
2073

  
2074
    tracker = Tracker.visible.first
2075
    tracker.core_fields = ['estimated_hours']
2076
    tracker.save!
2077
    query = IssueQuery.new
2078
    available_columns = query.available_columns.map(&:name)
2079
    assert_include :estimated_hours, available_columns
2080
    assert_include :total_estimated_hours, available_columns
2081
  end
2082

  
2064 2083
  def setup_member_of_group
2065 2084
    Group.destroy_all # No fixtures
2066 2085
    @user_in_group = User.generate!
    (1-1/1)