Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
count should be a string / trailing comma
`count` should be a string not an integer, though there should only ever be 1 result when searching by link anyway. Add a trailing comma for cleaner diffs(tm).
  • Loading branch information
Alice Bartlett committed Apr 9, 2015
commit 6c3d93f52a51fcffad75234530d510f37c4b2b66
4 changes: 2 additions & 2 deletions lib/search_api.rb
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,7 +33,7 @@ def scope_info
{
scope:{
title: scope_object.title,
}
},
}
else
{}
Expand All@@ -45,7 +45,7 @@ def rummager_params
end

def scope_object
@scope_object ||= api.unified_search(filter_link: scope_object_link, count: 1, fields: %w{title}).results.first
@scope_object ||= api.unified_search(filter_link: scope_object_link, count: "1", fields: %w{title}).results.first
end

def is_scoped?
Expand Down
2 changes: 1 addition & 1 deletion test/unit/search_api_test.rb
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,7 +33,7 @@ class SearchAPITest < ActiveSupport::TestCase
@search_params.expects(:filter).with('manual').returns([@manual_link])
@manual_search_response = stub(results: [stub(title: @manual_title)])

@rummager_api.expects(:unified_search).with(filter_link: @manual_link, count: 1, fields: %w{title}).returns(@manual_search_response)
@rummager_api.expects(:unified_search).with(filter_link: @manual_link, count: "1", fields: %w{title}).returns(@manual_search_response)
end

should "returns search results from rummager" do
Expand Down