summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--test/system/inline_autocomplete_test.rb22
2 files changed, 23 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 1dfa26cb2..031273d44 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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
diff --git a/test/system/inline_autocomplete_test.rb b/test/system/inline_autocomplete_test.rb
index 9a7d8f787..26a89b85d 100644
--- a/test/system/inline_autocomplete_test.rb
+++ b/test/system/inline_autocomplete_test.rb
@@ -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