From aa7ed0b2ba4c1f83534bb772efe2b5876a2bdd26 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 29 Jul 2014 16:36:19 +1000 Subject: [PATCH] FIX: remove broken find topic id feature --- lib/search.rb | 2 -- spec/components/search_spec.rb | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/lib/search.rb b/lib/search.rb index 92ccd250164..3c5d1462fcb 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -104,8 +104,6 @@ class Search return single_topic(route[:topic_id]).as_json if route[:topic_id].present? rescue ActionController::RoutingError end - - return single_topic(@term.to_i).as_json if @term =~ /^\d+$/ end find_grouped_results.as_json diff --git a/spec/components/search_spec.rb b/spec/components/search_spec.rb index a40d13054da..5f8eac105cd 100644 --- a/spec/components/search_spec.rb +++ b/spec/components/search_spec.rb @@ -199,16 +199,6 @@ describe Search do end end - context "search for a topic by id" do - let(:result) { first_of_type(Search.new(topic.id, type_filter: 'topic', min_search_term_length: 1).execute, 'topic') } - - it 'returns the topic' do - result.should be_present - result[:title].should == topic.title - result[:url].should == topic.relative_url - end - end - context "search for a topic by url" do let(:result) { first_of_type(Search.new(topic.relative_url, type_filter: 'topic').execute, 'topic') }