Skip to content

Commit

Permalink
count should be a string / trailing comma
Browse files Browse the repository at this point in the history
`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
1 parent 40b266d commit 6c3d93f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/search_api.rb
Original file line number Diff line number Diff 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 number Diff line number Diff 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

0 comments on commit 6c3d93f

Please sign in to comment.