Skip to content

Commit

Permalink
tests and documentation for ArticleSearch model
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbergja committed Mar 17, 2017
1 parent 337ad6d commit e6ae873
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/models/article_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ def enough_data_exists_in(record)
return true
end

# Create a new search object
#
# q: a query string
# page: a page number (can be an int or string)
# requested_facets: an array
# api_connection: and ApiConnection object or one of its descendants
def initialize(q, page, requested_facets = [], api_connection)
@q = q
@page = page
Expand Down
10 changes: 7 additions & 3 deletions test/models/article_search_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
require 'test_helper'


class ArticleSearchTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end

test "Article Search search_opts method returns an array" do
a = ArticleSearch.new 'soap opera', 3, [], nil
assert_instance_of Array, a.search_opts
end

end

0 comments on commit e6ae873

Please sign in to comment.