quick_search-core 0.0.1.test
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +168 -0
- data/Rakefile +6 -0
- data/app/assets/images/quick_search/askus.gif +0 -0
- data/app/assets/images/quick_search/favicon.ico +0 -0
- data/app/assets/images/quick_search/greybox.png +0 -0
- data/app/assets/images/quick_search/homescreen-icon-64x64.png +0 -0
- data/app/assets/images/quick_search/ncsu-library-logo-white.png +0 -0
- data/app/assets/javascripts/quick_search/appstats.js +8 -0
- data/app/assets/javascripts/quick_search/event_tracking.js.erb +257 -0
- data/app/assets/javascripts/quick_search/google_analytics.js.erb +8 -0
- data/app/assets/javascripts/quick_search/opensearch.js +2 -0
- data/app/assets/javascripts/quick_search/pages.js.coffee +3 -0
- data/app/assets/javascripts/quick_search/quicksearch.js +33 -0
- data/app/assets/javascripts/quick_search/realtime.js.erb +12 -0
- data/app/assets/javascripts/quick_search/search.js +3 -0
- data/app/assets/javascripts/quick_search/xhr_search.js +82 -0
- data/app/assets/javascripts/quick_search.js.erb +20 -0
- data/app/assets/stylesheets/foundation_and_overrides.scss +1327 -0
- data/app/assets/stylesheets/quick_search/appstats.css.scss +7 -0
- data/app/assets/stylesheets/quick_search/opensearch.css.scss +3 -0
- data/app/assets/stylesheets/quick_search/pages.css.scss +3 -0
- data/app/assets/stylesheets/quick_search/quick_search.css.scss +248 -0
- data/app/assets/stylesheets/quick_search/search.css.scss +3 -0
- data/app/assets/stylesheets/quick_search.css.scss.erb +7 -0
- data/app/controllers/concerns/quick_search/auth.rb +22 -0
- data/app/controllers/concerns/quick_search/doi_trap.rb +43 -0
- data/app/controllers/concerns/quick_search/encode_utf8.rb +12 -0
- data/app/controllers/concerns/quick_search/on_campus.rb +43 -0
- data/app/controllers/concerns/quick_search/query_filter.rb +25 -0
- data/app/controllers/concerns/quick_search/query_parser.rb +54 -0
- data/app/controllers/concerns/quick_search/searcher_concern.rb +101 -0
- data/app/controllers/concerns/quick_search/searcher_config.rb +16 -0
- data/app/controllers/quick_search/application_controller.rb +7 -0
- data/app/controllers/quick_search/appstats_controller.rb +210 -0
- data/app/controllers/quick_search/opensearch_controller.rb +9 -0
- data/app/controllers/quick_search/pages_controller.rb +18 -0
- data/app/controllers/quick_search/search_controller.rb +250 -0
- data/app/helpers/quick_search/application_helper.rb +68 -0
- data/app/helpers/quick_search/appstats_helper.rb +2 -0
- data/app/helpers/quick_search/opensearch_helper.rb +2 -0
- data/app/helpers/quick_search/pages_helper.rb +2 -0
- data/app/helpers/quick_search/search_helper.rb +2 -0
- data/app/models/event.rb +2 -0
- data/app/models/search.rb +11 -0
- data/app/searchers/quick_search/best_bets_searcher.rb +102 -0
- data/app/searchers/quick_search/searcher.rb +43 -0
- data/app/views/layouts/quick_search/_best_bets.html.erb +18 -0
- data/app/views/layouts/quick_search/_common_searches.html.erb +15 -0
- data/app/views/layouts/quick_search/_found_types.html.erb +13 -0
- data/app/views/layouts/quick_search/_google_analytics.html.erb +24 -0
- data/app/views/layouts/quick_search/_more_options.html.erb +10 -0
- data/app/views/layouts/quick_search/_page_title.html.erb +8 -0
- data/app/views/layouts/quick_search/_related_topics.html.erb +8 -0
- data/app/views/layouts/quick_search/_search_form.html.erb +19 -0
- data/app/views/layouts/quick_search/_spelling_suggestion.html.erb +13 -0
- data/app/views/layouts/quick_search/_topic_snippet.html.erb +5 -0
- data/app/views/layouts/quick_search/application.html.erb +40 -0
- data/app/views/quick_search/appstats/_click_count_table.html.erb +23 -0
- data/app/views/quick_search/appstats/_datatables.html.erb +12 -0
- data/app/views/quick_search/appstats/_date_range.html.erb +15 -0
- data/app/views/quick_search/appstats/_menu.html.erb +16 -0
- data/app/views/quick_search/appstats/_top_spot_report_table.html.erb +33 -0
- data/app/views/quick_search/appstats/clicks_overview.html.erb +20 -0
- data/app/views/quick_search/appstats/index.html.erb +31 -0
- data/app/views/quick_search/appstats/module_click_detail.html.erb +32 -0
- data/app/views/quick_search/appstats/realtime.html.erb +15 -0
- data/app/views/quick_search/appstats/top_searches.html.erb +38 -0
- data/app/views/quick_search/appstats/top_spot.html.erb +14 -0
- data/app/views/quick_search/appstats/top_spot_detail.html.erb +35 -0
- data/app/views/quick_search/kaminari/_first_page.html.erb +12 -0
- data/app/views/quick_search/kaminari/_gap.html.erb +11 -0
- data/app/views/quick_search/kaminari/_last_page.html.erb +12 -0
- data/app/views/quick_search/kaminari/_next_page.html.erb +12 -0
- data/app/views/quick_search/kaminari/_page.html.erb +13 -0
- data/app/views/quick_search/kaminari/_paginator.html.erb +25 -0
- data/app/views/quick_search/kaminari/_prev_page.html.erb +11 -0
- data/app/views/quick_search/opensearch/opensearch.xml.builder +11 -0
- data/app/views/quick_search/pages/about.html.erb +9 -0
- data/app/views/quick_search/pages/home.html.erb +6 -0
- data/app/views/quick_search/pages/realtime.html.erb +15 -0
- data/app/views/quick_search/search/_citation.html.erb +18 -0
- data/app/views/quick_search/search/_module.html.erb +37 -0
- data/app/views/quick_search/search/_module_with_paging.html.erb +14 -0
- data/app/views/quick_search/search/_no_results.html.erb +11 -0
- data/app/views/quick_search/search/_result.html.erb +17 -0
- data/app/views/quick_search/search/_result_details.html.erb +45 -0
- data/app/views/quick_search/search/_result_no_thumbnail.html.erb +3 -0
- data/app/views/quick_search/search/_result_title.html.erb +4 -0
- data/app/views/quick_search/search/_result_with_thumbnail.html.erb +21 -0
- data/app/views/quick_search/search/_search_error.html.erb +9 -0
- data/app/views/quick_search/search/_see_all.html.erb +11 -0
- data/app/views/quick_search/search/_xhr_response.html.erb +15 -0
- data/app/views/quick_search/search/_xhr_response.json.erb +14 -0
- data/app/views/quick_search/search/_xhr_response_with_paging.html.erb +1 -0
- data/app/views/quick_search/search/index.html.erb +100 -0
- data/config/application.rb +25 -0
- data/config/best_bets.yml +86 -0
- data/config/boot.rb +4 -0
- data/config/database.yml.example +31 -0
- data/config/locales/en.yml +30 -0
- data/config/quicksearch_config.yml.example +69 -0
- data/config/routes.rb +81 -0
- data/db/migrate/20140130202859_create_events.rb +11 -0
- data/db/migrate/20140130202944_create_searches.rb +9 -0
- data/db/migrate/20140225145441_add_page_to_searches.rb +5 -0
- data/db/schema.rb +31 -0
- data/db/seeds.rb +7 -0
- data/lib/benchmark_logger.rb +2 -0
- data/lib/capistrano/tasks/access_check.cap +10 -0
- data/lib/generators/quick_search/install_generator.rb +49 -0
- data/lib/generators/quick_search/templates/kaminari.rb +5 -0
- data/lib/generators/quick_search/templates/post_install.txt +8 -0
- data/lib/generators/quick_search/templates/quick_search_config.yml +58 -0
- data/lib/quick_search/engine.rb +16 -0
- data/lib/quick_search/version.rb +3 -0
- data/lib/quick_search.rb +12 -0
- data/lib/tasks/best_bets.rake +29 -0
- data/test/controllers/appstats_controller_test.rb +7 -0
- data/test/controllers/concerns/doi_trap_test.rb +19 -0
- data/test/controllers/concerns/on_campus_test.rb +19 -0
- data/test/controllers/concerns/query_parser_test.rb +47 -0
- data/test/controllers/opensearch_controller_test.rb +13 -0
- data/test/controllers/pages_controller_test.rb +7 -0
- data/test/controllers/search_controller_test.rb +15 -0
- data/test/fixtures/events.yml +11 -0
- data/test/fixtures/searches.yml +7 -0
- data/test/helpers/appstats_helper_test.rb +4 -0
- data/test/helpers/opensearch_helper_test.rb +4 -0
- data/test/helpers/pages_helper_test.rb +4 -0
- data/test/helpers/search_helper_test.rb +4 -0
- data/test/integration/catalog_search_test.rb +8 -0
- data/test/integration/google_analytics_test.rb +23 -0
- data/test/integration/landing_page_test.rb +8 -0
- data/test/integration/searching_test.rb +40 -0
- data/test/integration/smart_subjects_test.rb +8 -0
- data/test/integration/website_search_test.rb +8 -0
- data/test/models/event_test.rb +7 -0
- data/test/models/search_test.rb +7 -0
- data/test/searcher/best_bets_test.rb +35 -0
- data/test/searcher/catalog_test.rb +35 -0
- data/test/searcher/ematrix_database_test.rb +27 -0
- data/test/searcher/ematrix_journal_test.rb +27 -0
- data/test/searcher/faq_test.rb +27 -0
- data/test/searcher/smart_subjects_test.rb +27 -0
- data/test/searcher/summon_test.rb +13 -0
- data/test/searcher/website_test.rb +34 -0
- data/test/support/vcr_test.rb +40 -0
- data/test/test_helper.rb +42 -0
- metadata +366 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class BestBetsSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@best_bets = QuickSearch::BestBetsSearcher.new(HTTPClient.new, 'printing', 1)
|
7
|
+
@best_bets_journal = QuickSearch::BestBetsSearcher.new(HTTPClient.new, 'journal of cell science', 1)
|
8
|
+
@best_bets_database = QuickSearch::BestBetsSearcher.new(HTTPClient.new, 'encyclopedia of life sciences', 1)
|
9
|
+
end
|
10
|
+
|
11
|
+
test "should have http client, query, and per_page" do
|
12
|
+
assert @best_bets.http.is_a? HTTPClient
|
13
|
+
assert @best_bets.q == 'printing'
|
14
|
+
assert_equal 1, @best_bets.per_page
|
15
|
+
end
|
16
|
+
|
17
|
+
vcr_test "should have parsed results", 'searches', cassette: 'best_bets_printing' do
|
18
|
+
@best_bets.search
|
19
|
+
parsed_results = @best_bets.results
|
20
|
+
assert parsed_results.first.title.include?('Print')
|
21
|
+
end
|
22
|
+
|
23
|
+
vcr_test "should have journal result", 'searches', cassette: 'best_bets_journal' do
|
24
|
+
@best_bets_journal.search
|
25
|
+
parsed_results = @best_bets_journal.results
|
26
|
+
assert parsed_results.first.title.include?('Journal of cell science')
|
27
|
+
end
|
28
|
+
|
29
|
+
vcr_test "should have database result", 'searches', cassette: 'best_bets_database' do
|
30
|
+
@best_bets_database.search
|
31
|
+
parsed_results = @best_bets_database.results
|
32
|
+
assert parsed_results.first.title.include?('Encyclopedia of life sciences')
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class CatalogSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@catalog = QuickSearch::CatalogSearcher.new(HTTPClient.new, 'printing', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @catalog.http.is_a? HTTPClient
|
11
|
+
assert @catalog.q == 'printing'
|
12
|
+
assert_equal 3, @catalog.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
vcr_test "should have raw result", 'searches', cassette: 'catalog_printing' do
|
16
|
+
raw_results = @catalog.search
|
17
|
+
assert raw_results.children.first.name == 'searchResponse'
|
18
|
+
#assert raw_results['searchResponse']
|
19
|
+
end
|
20
|
+
|
21
|
+
vcr_test "should have parsed results", 'searches', cassette: 'catalog_printing' do
|
22
|
+
@catalog.search
|
23
|
+
parsed_results = @catalog.results
|
24
|
+
assert parsed_results.first.title.include?('Federal printing : overview and selected issues')
|
25
|
+
end
|
26
|
+
|
27
|
+
# # FIXME: this test should be moved to a result set object
|
28
|
+
# vcr_test "should have raw search results", "searches", cassette: 'printing' do
|
29
|
+
# summon = QuickSearch::SummonSearcher.new(HTTPClient.new, 'printing', 3)
|
30
|
+
# summon.search
|
31
|
+
# results = summon.results
|
32
|
+
# assert results.first.description.include?('Although we live in the digital age')
|
33
|
+
# end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class EmatrixDatabaseSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@database = QuickSearch::EmatrixDatabaseSearcher.new(HTTPClient.new, 'chemistry', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @database.http.is_a? HTTPClient
|
11
|
+
assert @database.q == 'chemistry'
|
12
|
+
assert_equal 3, @database.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
vcr_test "should have raw result", 'searches', cassette: 'ematrix_database_chemistry' do
|
16
|
+
raw_results = @database.search
|
17
|
+
assert raw_results.is_a?(Nokogiri::XML::Document)
|
18
|
+
end
|
19
|
+
|
20
|
+
vcr_test "should have parsed results", 'searches', cassette: 'ematrix_database_chemistry' do
|
21
|
+
@database.search
|
22
|
+
parsed_results = @database.results
|
23
|
+
assert parsed_results.first.title.include?('Encyclopedia of analytical chemistry')
|
24
|
+
assert parsed_results.first.link.include?('proxying.lib.ncsu.edu')
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class EmatrixJournalSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@journal = QuickSearch::EmatrixJournalSearcher.new(HTTPClient.new, 'chemistry', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @journal.http.is_a? HTTPClient
|
11
|
+
assert @journal.q == 'chemistry'
|
12
|
+
assert_equal 3, @journal.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
vcr_test "should have raw result", 'searches', cassette: 'ematrix_journal_chemistry' do
|
16
|
+
raw_results = @journal.search
|
17
|
+
assert raw_results.is_a?(Nokogiri::XML::Document)
|
18
|
+
end
|
19
|
+
|
20
|
+
vcr_test "should have parsed results", 'searches', cassette: 'ematrix_journal_chemistry' do
|
21
|
+
@journal.search
|
22
|
+
parsed_results = @journal.results
|
23
|
+
assert parsed_results.first.title.include?('Annual reports')
|
24
|
+
assert parsed_results.first.link.include?('33000')
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class FaqSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@faq = QuickSearch::FaqSearcher.new(HTTPClient.new, 'printing', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @faq.http.is_a? HTTPClient
|
11
|
+
assert @faq.q == 'printing'
|
12
|
+
assert_equal 3, @faq.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
# vcr_test "should have raw result", 'searches', cassette: 'faq_printing' do
|
16
|
+
# raw_results = @faq.search
|
17
|
+
# assert raw_results.is_a?(Sequel::MySQL::Dataset)
|
18
|
+
# end
|
19
|
+
|
20
|
+
# vcr_test "should have parsed results", 'searches', cassette: 'faq_printing' do
|
21
|
+
# @faq.search
|
22
|
+
# parsed_results = @faq.results
|
23
|
+
# assert parsed_results.first.title.include?('Print Quota')
|
24
|
+
# assert parsed_results.first.link.include?('274')
|
25
|
+
# end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SmartSubjectsSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@subjects = QuickSearch::SmartSubjectsSearcher.new(HTTPClient.new, 'chemistry', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @subjects.http.is_a? HTTPClient
|
11
|
+
assert @subjects.q == 'chemistry'
|
12
|
+
assert_equal 3, @subjects.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
vcr_test "should have raw result", 'searches', cassette: 'smart_subjects_chemistry' do
|
16
|
+
raw_results = @subjects.search
|
17
|
+
assert raw_results['responseHeader']
|
18
|
+
end
|
19
|
+
|
20
|
+
vcr_test "should have parsed results", 'searches', cassette: 'smart_subjects_chemistry' do
|
21
|
+
@subjects.search
|
22
|
+
parsed_results = @subjects.results
|
23
|
+
assert parsed_results.first.title.include?('Biochemistry')
|
24
|
+
assert parsed_results.first.link.include?('subject=13')
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SummonSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
# FIXME: this test should be moved to a result set object
|
6
|
+
vcr_test "should have author in result", "searches", cassette: 'printing' do
|
7
|
+
summon = QuickSearch::SummonSearcher.new(HTTPClient.new, 'printing', 3)
|
8
|
+
summon.search
|
9
|
+
results = summon.results
|
10
|
+
assert results.first.description.include?('Although we live in the digital age')
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class WebsiteSearcherTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@website = QuickSearch::WebsiteSearcher.new(HTTPClient.new, 'printing', 3)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should have http client, query, and per_page" do
|
10
|
+
assert @website.http.is_a? HTTPClient
|
11
|
+
assert @website.q == 'printing'
|
12
|
+
assert_equal 3, @website.per_page
|
13
|
+
end
|
14
|
+
|
15
|
+
vcr_test "should have raw result", 'searches', cassette: 'website_printing' do
|
16
|
+
raw_results = @website.search
|
17
|
+
assert raw_results['responseHeader']
|
18
|
+
end
|
19
|
+
|
20
|
+
vcr_test "should have parsed results", 'searches', cassette: 'website_printing' do
|
21
|
+
@website.search
|
22
|
+
parsed_results = @website.results
|
23
|
+
assert parsed_results.first.title.include?('Print')
|
24
|
+
end
|
25
|
+
|
26
|
+
# # FIXME: this test should be moved to a result set object
|
27
|
+
# vcr_test "should have raw search results", "searches", cassette: 'printing' do
|
28
|
+
# summon = QuickSearch::SummonSearcher.new(HTTPClient.new, 'printing', 3)
|
29
|
+
# summon.search
|
30
|
+
# results = summon.results
|
31
|
+
# assert results.first.description.include?('Although we live in the digital age')
|
32
|
+
# end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module VcrTest
|
2
|
+
def vcr_test(name, group = nil, vcr_options ={}, &block)
|
3
|
+
# cribbed from Rails and modified for VCR
|
4
|
+
# https://github.com/rails/rails/blob/b451de0d6de4df6bc66b274cec73b919f823d5ae/activesupport/lib/active_support/testing/declarative.rb#L25
|
5
|
+
|
6
|
+
if group.nil?
|
7
|
+
group = self.name.underscore
|
8
|
+
end
|
9
|
+
|
10
|
+
test_name_safe = name.gsub(/\s+/,'_')
|
11
|
+
|
12
|
+
test_method_name = "test_#{test_name_safe}".to_sym
|
13
|
+
|
14
|
+
raise "#{test_method_name} is already defined in #{self}" if methods.include?(test_method_name)
|
15
|
+
|
16
|
+
cassette_name = vcr_options.delete(:cassette)
|
17
|
+
unless cassette_name
|
18
|
+
# calculate default cassette name from test name
|
19
|
+
cassette_name = test_name_safe
|
20
|
+
end
|
21
|
+
|
22
|
+
# put in group subdir if group
|
23
|
+
cassette_name = "#{group}/#{cassette_name}" if group
|
24
|
+
|
25
|
+
# default tag with groupname, can be over-ridden.
|
26
|
+
vcr_options = {:tag => group}.merge(vcr_options) if group
|
27
|
+
|
28
|
+
if block_given?
|
29
|
+
define_method(test_method_name) do
|
30
|
+
VCR.use_cassette(cassette_name , vcr_options) do
|
31
|
+
instance_eval &block
|
32
|
+
end
|
33
|
+
end
|
34
|
+
else
|
35
|
+
define_method(test_method_name) do
|
36
|
+
flunk "No implementation provided for #{name}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
ENV["RAILS_ENV"] ||= "test"
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
3
|
+
require 'rails/test_help'
|
4
|
+
require 'capybara/rails'
|
5
|
+
require 'vcr'
|
6
|
+
|
7
|
+
# Load support files
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
9
|
+
|
10
|
+
class ActiveSupport::TestCase
|
11
|
+
ActiveRecord::Migration.check_pending!
|
12
|
+
extend VcrTest
|
13
|
+
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
14
|
+
#
|
15
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
16
|
+
# -- they do not yet inherit this setting
|
17
|
+
fixtures :all
|
18
|
+
|
19
|
+
# Add more helper methods to be used by all tests here...
|
20
|
+
end
|
21
|
+
|
22
|
+
class ActionDispatch::IntegrationTest
|
23
|
+
# Make the Capybara DSL available in all integration tests
|
24
|
+
include Capybara::DSL
|
25
|
+
Capybara.run_server = true
|
26
|
+
Capybara.server_port = 7000
|
27
|
+
Capybara.app_host = "http://localhost:#{Capybara.server_port}"
|
28
|
+
Capybara.javascript_driver = :webkit
|
29
|
+
Capybara.default_wait_time = 8
|
30
|
+
end
|
31
|
+
|
32
|
+
VCR.configure do |c|
|
33
|
+
# c.ignore_localhost = true
|
34
|
+
c.hook_into :webmock
|
35
|
+
c.cassette_library_dir = 'test/vcr_cassettes'
|
36
|
+
c.filter_sensitive_data('<AUTHORIZATION_CLIENT_KEY>') do |interaction|
|
37
|
+
QuickSearch::Engine::APP_CONFIG['summon']['client_key']
|
38
|
+
end
|
39
|
+
c.filter_sensitive_data('<AUTHORIZATION_SECRET_KEY>') do |interaction|
|
40
|
+
QuickSearch::Engine::APP_CONFIG['summon']['secret_key']
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,366 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: quick_search-core
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.test
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Beswick
|
8
|
+
- Cory Lown
|
9
|
+
- Jason Ronallo
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rails
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '4.1'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '4.1'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: kaminari
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: nokogiri
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: fastimage
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: mysql2
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rsolr
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
type: :runtime
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: exception_notification
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
type: :runtime
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: modernizr-rails
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :runtime
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: therubyracer
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: httpclient
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :runtime
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
description:
|
156
|
+
email:
|
157
|
+
- quicksearch@lists.ncsu.edu
|
158
|
+
executables: []
|
159
|
+
extensions: []
|
160
|
+
extra_rdoc_files: []
|
161
|
+
files:
|
162
|
+
- MIT-LICENSE
|
163
|
+
- README.md
|
164
|
+
- Rakefile
|
165
|
+
- app/assets/images/quick_search/askus.gif
|
166
|
+
- app/assets/images/quick_search/favicon.ico
|
167
|
+
- app/assets/images/quick_search/greybox.png
|
168
|
+
- app/assets/images/quick_search/homescreen-icon-64x64.png
|
169
|
+
- app/assets/images/quick_search/ncsu-library-logo-white.png
|
170
|
+
- app/assets/javascripts/quick_search.js.erb
|
171
|
+
- app/assets/javascripts/quick_search/appstats.js
|
172
|
+
- app/assets/javascripts/quick_search/event_tracking.js.erb
|
173
|
+
- app/assets/javascripts/quick_search/google_analytics.js.erb
|
174
|
+
- app/assets/javascripts/quick_search/opensearch.js
|
175
|
+
- app/assets/javascripts/quick_search/pages.js.coffee
|
176
|
+
- app/assets/javascripts/quick_search/quicksearch.js
|
177
|
+
- app/assets/javascripts/quick_search/realtime.js.erb
|
178
|
+
- app/assets/javascripts/quick_search/search.js
|
179
|
+
- app/assets/javascripts/quick_search/xhr_search.js
|
180
|
+
- app/assets/stylesheets/foundation_and_overrides.scss
|
181
|
+
- app/assets/stylesheets/quick_search.css.scss.erb
|
182
|
+
- app/assets/stylesheets/quick_search/appstats.css.scss
|
183
|
+
- app/assets/stylesheets/quick_search/opensearch.css.scss
|
184
|
+
- app/assets/stylesheets/quick_search/pages.css.scss
|
185
|
+
- app/assets/stylesheets/quick_search/quick_search.css.scss
|
186
|
+
- app/assets/stylesheets/quick_search/search.css.scss
|
187
|
+
- app/controllers/concerns/quick_search/auth.rb
|
188
|
+
- app/controllers/concerns/quick_search/doi_trap.rb
|
189
|
+
- app/controllers/concerns/quick_search/encode_utf8.rb
|
190
|
+
- app/controllers/concerns/quick_search/on_campus.rb
|
191
|
+
- app/controllers/concerns/quick_search/query_filter.rb
|
192
|
+
- app/controllers/concerns/quick_search/query_parser.rb
|
193
|
+
- app/controllers/concerns/quick_search/searcher_concern.rb
|
194
|
+
- app/controllers/concerns/quick_search/searcher_config.rb
|
195
|
+
- app/controllers/quick_search/application_controller.rb
|
196
|
+
- app/controllers/quick_search/appstats_controller.rb
|
197
|
+
- app/controllers/quick_search/opensearch_controller.rb
|
198
|
+
- app/controllers/quick_search/pages_controller.rb
|
199
|
+
- app/controllers/quick_search/search_controller.rb
|
200
|
+
- app/helpers/quick_search/application_helper.rb
|
201
|
+
- app/helpers/quick_search/appstats_helper.rb
|
202
|
+
- app/helpers/quick_search/opensearch_helper.rb
|
203
|
+
- app/helpers/quick_search/pages_helper.rb
|
204
|
+
- app/helpers/quick_search/search_helper.rb
|
205
|
+
- app/models/event.rb
|
206
|
+
- app/models/search.rb
|
207
|
+
- app/searchers/quick_search/best_bets_searcher.rb
|
208
|
+
- app/searchers/quick_search/searcher.rb
|
209
|
+
- app/views/layouts/quick_search/_best_bets.html.erb
|
210
|
+
- app/views/layouts/quick_search/_common_searches.html.erb
|
211
|
+
- app/views/layouts/quick_search/_found_types.html.erb
|
212
|
+
- app/views/layouts/quick_search/_google_analytics.html.erb
|
213
|
+
- app/views/layouts/quick_search/_more_options.html.erb
|
214
|
+
- app/views/layouts/quick_search/_page_title.html.erb
|
215
|
+
- app/views/layouts/quick_search/_related_topics.html.erb
|
216
|
+
- app/views/layouts/quick_search/_search_form.html.erb
|
217
|
+
- app/views/layouts/quick_search/_spelling_suggestion.html.erb
|
218
|
+
- app/views/layouts/quick_search/_topic_snippet.html.erb
|
219
|
+
- app/views/layouts/quick_search/application.html.erb
|
220
|
+
- app/views/quick_search/appstats/_click_count_table.html.erb
|
221
|
+
- app/views/quick_search/appstats/_datatables.html.erb
|
222
|
+
- app/views/quick_search/appstats/_date_range.html.erb
|
223
|
+
- app/views/quick_search/appstats/_menu.html.erb
|
224
|
+
- app/views/quick_search/appstats/_top_spot_report_table.html.erb
|
225
|
+
- app/views/quick_search/appstats/clicks_overview.html.erb
|
226
|
+
- app/views/quick_search/appstats/index.html.erb
|
227
|
+
- app/views/quick_search/appstats/module_click_detail.html.erb
|
228
|
+
- app/views/quick_search/appstats/realtime.html.erb
|
229
|
+
- app/views/quick_search/appstats/top_searches.html.erb
|
230
|
+
- app/views/quick_search/appstats/top_spot.html.erb
|
231
|
+
- app/views/quick_search/appstats/top_spot_detail.html.erb
|
232
|
+
- app/views/quick_search/kaminari/_first_page.html.erb
|
233
|
+
- app/views/quick_search/kaminari/_gap.html.erb
|
234
|
+
- app/views/quick_search/kaminari/_last_page.html.erb
|
235
|
+
- app/views/quick_search/kaminari/_next_page.html.erb
|
236
|
+
- app/views/quick_search/kaminari/_page.html.erb
|
237
|
+
- app/views/quick_search/kaminari/_paginator.html.erb
|
238
|
+
- app/views/quick_search/kaminari/_prev_page.html.erb
|
239
|
+
- app/views/quick_search/opensearch/opensearch.xml.builder
|
240
|
+
- app/views/quick_search/pages/about.html.erb
|
241
|
+
- app/views/quick_search/pages/home.html.erb
|
242
|
+
- app/views/quick_search/pages/realtime.html.erb
|
243
|
+
- app/views/quick_search/search/_citation.html.erb
|
244
|
+
- app/views/quick_search/search/_module.html.erb
|
245
|
+
- app/views/quick_search/search/_module_with_paging.html.erb
|
246
|
+
- app/views/quick_search/search/_no_results.html.erb
|
247
|
+
- app/views/quick_search/search/_result.html.erb
|
248
|
+
- app/views/quick_search/search/_result_details.html.erb
|
249
|
+
- app/views/quick_search/search/_result_no_thumbnail.html.erb
|
250
|
+
- app/views/quick_search/search/_result_title.html.erb
|
251
|
+
- app/views/quick_search/search/_result_with_thumbnail.html.erb
|
252
|
+
- app/views/quick_search/search/_search_error.html.erb
|
253
|
+
- app/views/quick_search/search/_see_all.html.erb
|
254
|
+
- app/views/quick_search/search/_xhr_response.html.erb
|
255
|
+
- app/views/quick_search/search/_xhr_response.json.erb
|
256
|
+
- app/views/quick_search/search/_xhr_response_with_paging.html.erb
|
257
|
+
- app/views/quick_search/search/index.html.erb
|
258
|
+
- config/application.rb
|
259
|
+
- config/best_bets.yml
|
260
|
+
- config/boot.rb
|
261
|
+
- config/database.yml.example
|
262
|
+
- config/locales/en.yml
|
263
|
+
- config/quicksearch_config.yml.example
|
264
|
+
- config/routes.rb
|
265
|
+
- db/migrate/20140130202859_create_events.rb
|
266
|
+
- db/migrate/20140130202944_create_searches.rb
|
267
|
+
- db/migrate/20140225145441_add_page_to_searches.rb
|
268
|
+
- db/schema.rb
|
269
|
+
- db/seeds.rb
|
270
|
+
- lib/benchmark_logger.rb
|
271
|
+
- lib/capistrano/tasks/access_check.cap
|
272
|
+
- lib/generators/quick_search/install_generator.rb
|
273
|
+
- lib/generators/quick_search/templates/kaminari.rb
|
274
|
+
- lib/generators/quick_search/templates/post_install.txt
|
275
|
+
- lib/generators/quick_search/templates/quick_search_config.yml
|
276
|
+
- lib/quick_search.rb
|
277
|
+
- lib/quick_search/engine.rb
|
278
|
+
- lib/quick_search/version.rb
|
279
|
+
- lib/tasks/best_bets.rake
|
280
|
+
- test/controllers/appstats_controller_test.rb
|
281
|
+
- test/controllers/concerns/doi_trap_test.rb
|
282
|
+
- test/controllers/concerns/on_campus_test.rb
|
283
|
+
- test/controllers/concerns/query_parser_test.rb
|
284
|
+
- test/controllers/opensearch_controller_test.rb
|
285
|
+
- test/controllers/pages_controller_test.rb
|
286
|
+
- test/controllers/search_controller_test.rb
|
287
|
+
- test/fixtures/events.yml
|
288
|
+
- test/fixtures/searches.yml
|
289
|
+
- test/helpers/appstats_helper_test.rb
|
290
|
+
- test/helpers/opensearch_helper_test.rb
|
291
|
+
- test/helpers/pages_helper_test.rb
|
292
|
+
- test/helpers/search_helper_test.rb
|
293
|
+
- test/integration/catalog_search_test.rb
|
294
|
+
- test/integration/google_analytics_test.rb
|
295
|
+
- test/integration/landing_page_test.rb
|
296
|
+
- test/integration/searching_test.rb
|
297
|
+
- test/integration/smart_subjects_test.rb
|
298
|
+
- test/integration/website_search_test.rb
|
299
|
+
- test/models/event_test.rb
|
300
|
+
- test/models/search_test.rb
|
301
|
+
- test/searcher/best_bets_test.rb
|
302
|
+
- test/searcher/catalog_test.rb
|
303
|
+
- test/searcher/ematrix_database_test.rb
|
304
|
+
- test/searcher/ematrix_journal_test.rb
|
305
|
+
- test/searcher/faq_test.rb
|
306
|
+
- test/searcher/smart_subjects_test.rb
|
307
|
+
- test/searcher/summon_test.rb
|
308
|
+
- test/searcher/website_test.rb
|
309
|
+
- test/support/vcr_test.rb
|
310
|
+
- test/test_helper.rb
|
311
|
+
homepage: http://www.github.com/ncsu-libraries/quick_search
|
312
|
+
licenses:
|
313
|
+
- MIT
|
314
|
+
metadata: {}
|
315
|
+
post_install_message:
|
316
|
+
rdoc_options: []
|
317
|
+
require_paths:
|
318
|
+
- lib
|
319
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
320
|
+
requirements:
|
321
|
+
- - ">="
|
322
|
+
- !ruby/object:Gem::Version
|
323
|
+
version: '2.1'
|
324
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
325
|
+
requirements:
|
326
|
+
- - ">"
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
version: 1.3.1
|
329
|
+
requirements: []
|
330
|
+
rubyforge_project:
|
331
|
+
rubygems_version: 2.4.8
|
332
|
+
signing_key:
|
333
|
+
specification_version: 4
|
334
|
+
summary: QuickSearch is a toolkit for easily creating custom bento-box search applications
|
335
|
+
test_files:
|
336
|
+
- test/controllers/appstats_controller_test.rb
|
337
|
+
- test/controllers/concerns/doi_trap_test.rb
|
338
|
+
- test/controllers/concerns/on_campus_test.rb
|
339
|
+
- test/controllers/concerns/query_parser_test.rb
|
340
|
+
- test/controllers/opensearch_controller_test.rb
|
341
|
+
- test/controllers/pages_controller_test.rb
|
342
|
+
- test/controllers/search_controller_test.rb
|
343
|
+
- test/fixtures/events.yml
|
344
|
+
- test/fixtures/searches.yml
|
345
|
+
- test/helpers/appstats_helper_test.rb
|
346
|
+
- test/helpers/opensearch_helper_test.rb
|
347
|
+
- test/helpers/pages_helper_test.rb
|
348
|
+
- test/helpers/search_helper_test.rb
|
349
|
+
- test/integration/catalog_search_test.rb
|
350
|
+
- test/integration/google_analytics_test.rb
|
351
|
+
- test/integration/landing_page_test.rb
|
352
|
+
- test/integration/searching_test.rb
|
353
|
+
- test/integration/smart_subjects_test.rb
|
354
|
+
- test/integration/website_search_test.rb
|
355
|
+
- test/models/event_test.rb
|
356
|
+
- test/models/search_test.rb
|
357
|
+
- test/searcher/best_bets_test.rb
|
358
|
+
- test/searcher/catalog_test.rb
|
359
|
+
- test/searcher/ematrix_database_test.rb
|
360
|
+
- test/searcher/ematrix_journal_test.rb
|
361
|
+
- test/searcher/faq_test.rb
|
362
|
+
- test/searcher/smart_subjects_test.rb
|
363
|
+
- test/searcher/summon_test.rb
|
364
|
+
- test/searcher/website_test.rb
|
365
|
+
- test/support/vcr_test.rb
|
366
|
+
- test/test_helper.rb
|