bento_search 1.7.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -6
- data/app/assets/javascripts/bento_search/ajax_load.js +17 -1
- data/app/controllers/bento_search/search_controller.rb +2 -2
- data/app/models/bento_search/concurrent_searcher.rb +2 -2
- data/app/models/bento_search/result_item.rb +5 -2
- data/app/views/bento_search/_item_title.html.erb +2 -4
- data/lib/bento_search/version.rb +1 -1
- data/lib/generators/bento_search/install/ajax_load_js_generator.rb +15 -0
- data/test/decorator/standard_decorator_test.rb +30 -30
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/config/application.rb +7 -0
- data/test/dummy/config/environments/development.rb +2 -0
- data/test/dummy/config/environments/production.rb +7 -1
- data/test/dummy/config/environments/test.rb +10 -3
- data/test/functional/bento_search/search_controller_test.rb +5 -1
- data/test/search_engines/google_site_search_test.rb +48 -48
- data/test/search_engines/scopus_engine_test.rb +51 -51
- data/test/support/atom.xsd.xml +3 -3
- data/test/support/xml.xsd +117 -0
- data/test/view/atom_results_test.rb +94 -94
- metadata +27 -49
- data/app/assets/javascripts/bento_search.js +0 -3
- data/app/item_decorators/bento_search/ebscohost/conditional_openurl_main_link.rb +0 -36
- data/app/item_decorators/bento_search/only_premade_openurl.rb +0 -20
- data/app/item_decorators/bento_search/openurl_add_other_link.rb +0 -39
- data/app/item_decorators/bento_search/openurl_main_link.rb +0 -34
- data/app/models/bento_search/multi_searcher.rb +0 -132
- data/test/dummy/config/initializers/secret_token.rb +0 -8
- data/test/dummy/db/schema.rb +0 -15
- data/test/unit/multi_searcher_test.rb +0 -46
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.secret_token = '78ee4771fe1d7704b7dd8f47b879db32af098e4cf67f9910e9cf7fe8de18353ff52dc3ccb48ed341745aaedbad9ba79f031867b0e37680f2fb5b66b76838db22'
|
8
|
-
Dummy::Application.config.secret_key_base = '60f73d25f61301b1ea3119011efb9fd9a741fcc010757599341d45765fbda7676daf5d602fb17bb5085c3163a04e20c0750ad02562ee9cb7f03f813d1b62c639'
|
data/test/dummy/db/schema.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 0) do
|
14
|
-
|
15
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
# Doesn't really test the concurrency, but basic smoke test with fake
|
4
|
-
# searchers.
|
5
|
-
class MultiSearcherTest < ActiveSupport::TestCase
|
6
|
-
setup do
|
7
|
-
BentoSearch.register_engine("one") do |conf|
|
8
|
-
conf.engine = "MockEngine"
|
9
|
-
end
|
10
|
-
BentoSearch.register_engine("two") do |conf|
|
11
|
-
conf.engine = "MockEngine"
|
12
|
-
end
|
13
|
-
BentoSearch.register_engine("three") do |conf|
|
14
|
-
conf.engine = "MockEngine"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
teardown do
|
19
|
-
BentoSearch.reset_engine_registrations!
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
def test_multisearch
|
24
|
-
ActiveSupport::Deprecation.silence do
|
25
|
-
searcher = BentoSearch::MultiSearcher.new(:one, :two, :three)
|
26
|
-
start_returnval = searcher.start("cancer")
|
27
|
-
|
28
|
-
assert_same searcher, start_returnval
|
29
|
-
|
30
|
-
results = searcher.results
|
31
|
-
|
32
|
-
assert_kind_of Hash, results
|
33
|
-
assert_equal ["one", "two", "three"].sort, results.keys.sort
|
34
|
-
|
35
|
-
["one", "two", "three"].each do |key|
|
36
|
-
assert_kind_of BentoSearch::Results, results[key]
|
37
|
-
end
|
38
|
-
|
39
|
-
# call results again, we get an empty hash, can only call
|
40
|
-
# results once per start.
|
41
|
-
new_results = searcher.results
|
42
|
-
assert_kind_of Hash, new_results
|
43
|
-
assert_empty new_results
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|