Merge pull request #300 from rubys/fix-autocomplete-json-accept

Ask for JSON when autocompleting people to ping
This commit is contained in:
Stanko Krtalić
2026-10-05 16:17:10 +02:00
committed by GitHub
2 changed files with 16 additions and 1 deletions
@@ -120,7 +120,7 @@ export default class BaseAutocompleteHandler {
#fetchAutocompletables(url) {
if (url) {
return fetch(url, { as: "json" }).then(response => response.json())
return fetch(url, { headers: { Accept: "application/json" } }).then(response => response.json())
} else {
return Promise.resolve()
}
+15
View File
@@ -0,0 +1,15 @@
require "application_system_test_case"
class StartingPingsTest < ApplicationSystemTestCase
setup do
sign_in "kevin@37signals.com"
end
test "suggesting people to ping" do
visit new_rooms_direct_url
find("[data-autocomplete-target='input']").send_keys("Jas")
assert_selector "suggestion-option[role='option']", text: "Jason"
end
end