Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
Change all instances of unified_search to search
Browse files Browse the repository at this point in the history
This commit changes all instances of `unified_search` to `search` when using the GDS API Adapters to access rummager. This provides consistency between the internal and external APIs in terms of naming.
  • Loading branch information
Ruben Arakelyan committed Aug 31, 2016
1 parent 8dd88e0 commit 0fd5959
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -8,7 +8,7 @@ gem 'rack-rewrite', '1.3.3'
gem 'govuk_frontend_toolkit', '1.4.0'
gem 'plek', '1.11.0'
gem 'rummageable', '1.2.0'
gem 'gds-api-adapters', '26.7.0'
gem 'gds-api-adapters', '34.1.0'

if ENV['SLIMMER_DEV']
gem 'slimmer', :path => '../slimmer'
Expand Down
51 changes: 25 additions & 26 deletions Gemfile.lock
Expand Up @@ -35,28 +35,27 @@ GEM
multi_json
arel (3.0.3)
builder (3.0.4)
capybara (2.7.1)
capybara (2.8.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
daemons (1.1.9)
daemons (1.2.4)
diff-lcs (1.2.5)
domain_name (0.5.24)
domain_name (0.5.20160615)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (1.4.0)
multi_json (~> 1.0)
gds-api-adapters (26.7.0)
eventmachine (1.2.0.1)
execjs (2.7.0)
gds-api-adapters (34.1.0)
link_header
lrucache (~> 0.1.1)
null_logger
plek
plek (>= 1.9.0)
rack-cache
rest-client (~> 1.8.0)
rest-client (~> 2.0)
govuk_frontend_toolkit (1.4.0)
rails (>= 3.1.0)
sass (>= 3.2.0)
Expand All @@ -66,8 +65,8 @@ GEM
i18n (0.7.0)
journey (1.0.4)
json (1.8.3)
kgio (2.7.4)
libv8 (3.16.14.11)
kgio (2.10.0)
libv8 (3.16.14.15)
link_header (0.0.8)
logstash-event (1.1.5)
logstasher (0.4.8)
Expand All @@ -77,13 +76,13 @@ GEM
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
metaclass (0.0.4)
mime-types (1.25.1)
mini_portile2 (2.1.0)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.12.1)
netrc (0.10.3)
netrc (0.11.0)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
Expand Down Expand Up @@ -114,15 +113,15 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.10.0)
raindrops (0.17.0)
rake (11.2.2)
rdoc (3.12.2)
json (~> 1.4)
ref (1.0.5)
rest-client (1.8.0)
ref (2.0.0)
rest-client (2.0.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rspec-core (3.5.2)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
Expand All @@ -131,7 +130,7 @@ GEM
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.1)
rspec-rails (3.5.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
Expand All @@ -144,7 +143,7 @@ GEM
multi_json
null_logger
rest-client
sass (3.4.7)
sass (3.4.22)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
Expand All @@ -165,10 +164,10 @@ GEM
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thin (1.7.0)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
Expand All @@ -180,7 +179,7 @@ GEM
multi_json (~> 1.3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unf_ext (0.0.7.2)
unicorn (4.3.1)
kgio (~> 2.6)
rack
Expand All @@ -194,7 +193,7 @@ PLATFORMS
DEPENDENCIES
airbrake (= 3.1.17)
capybara
gds-api-adapters (= 26.7.0)
gds-api-adapters (= 34.1.0)
govuk_frontend_toolkit (= 1.4.0)
logstasher (= 0.4.8)
mocha (= 0.13.3)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Expand Up @@ -15,7 +15,7 @@ def index
if @search_term.blank?
@results = []
else
res = search_client.unified_search(q: @search_term, filter_manual: "/service-manual")
res = search_client.search(q: @search_term, filter_manual: "/service-manual")
@results = res["results"].map { |r| SearchResult.new(r) }
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/controller/search_controller_spec.rb
Expand Up @@ -3,7 +3,7 @@

describe SearchController, :type => :controller do
def stub_client
stub_search_client = double("search", unified_search: { "results" => [] })
stub_search_client = double("search", search: { "results" => [] })
controller.stubs(:search_client).returns(stub_search_client)
end

Expand All @@ -16,7 +16,7 @@ def do_search(term = 'search-term')
end

it "should pass our query parameter in to the search client" do
controller.search_client.expects(:unified_search)
controller.search_client.expects(:search)
.with(q: "search-term", filter_manual: "/service-manual")
.returns("results" => []).once
do_search
Expand All @@ -28,7 +28,7 @@ def do_search(term = 'search-term')
end

it "should return unlimited results" do
controller.search_client.stubs(:unified_search)
controller.search_client.stubs(:search)
.returns("results" => Array.new(75, {}))

do_search('Test')
Expand Down

0 comments on commit 0fd5959

Please sign in to comment.