Patch #44190 » 0001-Add-tests-for-mention-autocomplete.patch
| test/functional/watchers_controller_test.rb | ||
|---|---|---|
| 455 | 455 |
assert_not_include hidden.name, response.body |
| 456 | 456 |
end |
| 457 | 457 | |
| 458 |
def test_autocomplete_for_mention |
|
| 459 |
@request.session[:user_id] = 1 |
|
| 460 |
get :autocomplete_for_mention, params: {
|
|
| 461 |
project_id: 'ecookbook', |
|
| 462 |
object_type: 'issue', |
|
| 463 |
object_id: '1', |
|
| 464 |
q: 'john' |
|
| 465 |
}, xhr: true |
|
| 466 | ||
| 467 |
assert_response :success |
|
| 468 |
assert_equal ['jsmith'], response.parsed_body.pluck('login')
|
|
| 469 |
end |
|
| 470 | ||
| 471 |
def test_autocomplete_for_mention_without_query |
|
| 472 |
@request.session[:user_id] = 1 |
|
| 473 |
get :autocomplete_for_mention, params: {
|
|
| 474 |
project_id: 'ecookbook', |
|
| 475 |
object_type: 'issue', |
|
| 476 |
object_id: '1', |
|
| 477 |
q: '' |
|
| 478 |
}, xhr: true |
|
| 479 | ||
| 480 |
assert_response :success |
|
| 481 |
assert_equal ['dlopper', 'jsmith'], response.parsed_body.pluck('login')
|
|
| 482 |
end |
|
| 483 | ||
| 458 | 484 |
def test_autocomplete_for_user_should_not_return_users_without_object_visibility |
| 459 | 485 |
@request.session[:user_id] = 1 |
| 460 | 486 |
get :autocomplete_for_user, :params => {
|
- « Previous
- 1
- 2
- Next »