Browse Source

Fixes #3058 - Search details sidebar name shows URL-encoded gibberish

Mantas 4 years ago
parent
commit
ff5f175640
2 changed files with 19 additions and 4 deletions
  1. 2 4
      app/assets/javascripts/app/controllers/search.coffee
  2. 17 0
      spec/system/search_spec.rb

+ 2 - 4
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:    ''

+ 17 - 0
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