From 92213813d402109ab9661b7ab725665948626ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 30 Oct 2019 10:37:18 +0100 Subject: [PATCH] Revert "FIX: Require q param in /tags/filter/search route (#8263)" This reverts commit 968a1419df9b93e484b080bd5bbae004146742ba. --- app/controllers/tags_controller.rb | 2 -- spec/requests/tags_controller_spec.rb | 9 --------- 2 files changed, 11 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 18a4f6e000f..19629600ae0 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -193,8 +193,6 @@ class TagsController < ::ApplicationController end def search - params.require(:q) - clean_name = DiscourseTagging.clean_tag(params[:q]) category = params[:categoryId] ? Category.find_by_id(params[:categoryId]) : nil diff --git a/spec/requests/tags_controller_spec.rb b/spec/requests/tags_controller_spec.rb index a68977112b2..26bf9591706 100644 --- a/spec/requests/tags_controller_spec.rb +++ b/spec/requests/tags_controller_spec.rb @@ -428,15 +428,6 @@ describe TagsController do json = ::JSON.parse(response.body) expect(json["results"].map { |j| j["id"] }).to eq(['тема-в-разработке']) end - - context 'when tag query parameter is not provided' do - it 'does not cause a 500 error, returns a param required message' do - get "/tags/filter/search.json", params: {} - expect(response.status).to eq(400) - json = ::JSON.parse(response.body) - expect(json['errors']).to include('param is missing or the value is empty: q') - end - end end end