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
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