From ff5f1756406d3394e7157a1c00a316abcfe77aab Mon Sep 17 00:00:00 2001 From: Mantas Date: Tue, 19 May 2020 14:44:12 +0300 Subject: [PATCH] Fixes #3058 - Search details sidebar name shows URL-encoded gibberish --- .../javascripts/app/controllers/search.coffee | 6 ++---- spec/system/search_spec.rb | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 spec/system/search_spec.rb diff --git a/app/assets/javascripts/app/controllers/search.coffee b/app/assets/javascripts/app/controllers/search.coffee index 33751184f..699563ec3 100644 --- a/app/assets/javascripts/app/controllers/search.coffee +++ b/app/assets/javascripts/app/controllers/search.coffee @@ -37,10 +37,8 @@ class App.Search extends App.Controller ) meta: => - if @query - title = App.Utils.htmlEscape(@query) - else - title = App.i18n.translateInline('Extended Search') + title = @query || App.i18n.translateInline('Extended Search') + meta = url: @url() id: '' diff --git a/spec/system/search_spec.rb b/spec/system/search_spec.rb new file mode 100644 index 000000000..c8000785e --- /dev/null +++ b/spec/system/search_spec.rb @@ -0,0 +1,17 @@ +require 'rails_helper' + +RSpec.describe 'Search', type: :system, authenticated: true, searchindex: true do + before do + configure_elasticsearch(required: true, rebuild: true) + end + + it 'shows default widgets' do + fill_in id: 'global-search', with: '"Welcome"' + + click_on 'Show Search Details' + + within '#navigation .tasks a[data-key=Search]' do + expect(page).to have_text '"Welcome"' + end + end +end