1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-10 19:23:06 +00:00

Merged r21569 to 5.0-stable (#36909).

git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21571 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu 2022-05-12 05:47:01 +00:00
parent a9840f3c1f
commit 88d033f7f6
2 changed files with 23 additions and 3 deletions

View File

@ -1831,9 +1831,7 @@ module ApplicationHelper
def update_data_sources_for_auto_complete(data_sources)
javascript_tag(
"const currentDataSources = rm.AutoComplete.dataSources;" \
"const newDataSources = JSON.parse('#{data_sources.to_json}'); " \
"rm.AutoComplete.dataSources = Object.assign(currentDataSources, newDataSources);"
"rm.AutoComplete.dataSources = Object.assign(rm.AutoComplete.dataSources, JSON.parse('#{data_sources.to_json}'));"
)
end

View File

@ -164,4 +164,26 @@ class InlineAutocompleteSystemTest < ApplicationSystemTestCase
assert page.has_text? "Bug ##{issue.id}: This issue has a <select> element"
end
end
def test_inline_autocomplete_for_users_should_work_after_status_change
log_user('jsmith', 'jsmith')
visit '/issues/1/edit'
find('#issue_notes').click
fill_in 'issue[notes]', :with => '@lopper'
within('.tribute-container') do
assert page.has_text? "Dave Lopper"
end
page.find('#issue_status_id').select('Feedback')
find('#issue_notes').click
fill_in 'issue[notes]', :with => '@lopper'
within('.tribute-container') do
assert page.has_text? "Dave Lopper"
end
end
end