Defect #41079 » test-41079.patch
test/unit/query_test.rb | ||
---|---|---|
3344 | 3344 | |
3345 | 3345 |
assert_equal 'board', query.display_type |
3346 | 3346 |
end |
3347 | ||
3348 |
def test_assigned_to_values_should_be_sorted_by_status_and_name |
|
3349 |
User.delete_all |
|
3350 |
20.times do |i| |
|
3351 |
str = format('%03d', i) |
|
3352 |
status = i.even? ? User::STATUS_ACTIVE : User::STATUS_LOCKED |
|
3353 |
User.create!(firstname: str, lastname: str, login: str, mail: "#{str}@example.net", status: status) |
|
3354 |
end |
|
3355 |
query = IssueQuery.new(:name => '_') |
|
3356 |
query.stubs(:users).returns(User.all) |
|
3357 | ||
3358 |
expected_names = User.order(:status, :firstname).all.map(&:name) |
|
3359 |
assigned_to_values = query.assigned_to_values |
|
3360 |
assert_equal expected_names, assigned_to_values[1..].map(&:first) |
|
3361 |
end |
|
3347 | 3362 |
end |
- « Previous
- 1
- …
- 4
- 5
- 6
- Next »