Project

General

Profile

Defect #29581 » add-test-that-fails-when-using-postgresql.patch

Mizuki ISHIKAWA, 2018-09-10 07:35

View differences:

test/unit/query_test.rb
2178 2178

  
2179 2179
    assert_equal ['1','2','3','4','5','6'], query.available_filters['status_id'][:values].map(&:second)
2180 2180
  end
2181

  
2182
  def test_issues_with_offset_and_limit
2183
    q = IssueQuery.new
2184
    q.sort_criteria = {'0' => ['priority', 'desc']}
2185

  
2186
    issue_ids = q.issues.pluck(:id)
2187
    paginated_issue_ids = []
2188
    ((q.issue_count / 2) + 1).times do |i|
2189
      paginated_issue_ids += q.issues(:offset => (i * 2), :limit => 2).pluck(:id)
2190
    end
2191

  
2192
    # Non-paginated issue ids and paginated issue ids should be the same.
2193
    assert_equal issue_ids, paginated_issue_ids
2194
    assert_equal paginated_issue_ids.count, paginated_issue_ids.uniq.count
2195
  end
2181 2196
end
(1-1/4)