Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCC Library committed Apr 6, 2017
2 parents a875363 + e6ae873 commit 359b833
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CatalogController < ApplicationController
config.add_facet_field 'subject_era_facet', :label => 'Era of focus', :limit => true, :sort => 'count'
config.add_facet_field 'subject_name_facet', :label => 'People and groups', :limit => true, :sort => 'count'
config.add_facet_field 'genre_facet', :label => 'Genre', :limit => true, :sort => 'count'
config.add_facet_field 'series_facet', :label => 'Series', :limit => true, :sort => 'count'
config.add_facet_field 'record_source_facet', :label => 'Source database', :limit => true

=begin
Expand Down
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 359b833

Please sign in to comment.