active-fedora 9.8.2 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 649deb26ad5996b290d97012ef63c57c9b0adbe6
4
- data.tar.gz: deaec7e3b53d51ea1a02c2bd7d2b9b94b57a4ffc
3
+ metadata.gz: f5ecd9f636c3db3dc10bd6d83a91f7a279b002ad
4
+ data.tar.gz: 9d479bd9af1691992fc227386e52cd12f93a9f6e
5
5
  SHA512:
6
- metadata.gz: a68489b40710a2c6309a7e11f041d0f4caeb5dfb4f069bddce70dd04af88979575c00bccecc7b65a644b03db3c93583342d5c41035ab5d54d82effdb444bb653
7
- data.tar.gz: a02c29e941b1c014c3ef95dd1c116537df836423e75fa3e48c539c8b66a7f68605983c89582a990177172b558eb05a060b43bdb864b243519a8d03e67147bf6b
6
+ metadata.gz: 9c791a3b110cce3af5e7a290e5f60f3a0ac505e737ef081ce2e8a8295c5d276cdafe3da753ba02e08a08e2781de9e93c74775a7656c5583aba56ff26b28ee7ba
7
+ data.tar.gz: 0307cb665d50fe8413bc776a2cb3af74a8dfee911c41ce0a9270a4ce93177ccb72cc4827cb34a61ef21fe85d8937e1931062150e0ce30a00cbb0a9f92d03a3b0
@@ -1,3 +1,32 @@
1
+ v9.9.0
2
+ 2016-02-15: Update development configs to use environment variables [Justin
3
+ Coyne]
4
+
5
+ 2016-02-15: Pin to a version of rubocop-rspec that doesn't complain about our
6
+ code [Justin Coyne]
7
+
8
+ 2016-02-15: Generalize the with_server method [Justin Coyne]
9
+
10
+ 2016-02-12: Use local configurations for solr [Justin Coyne]
11
+
12
+ 2016-02-12: Share the test server method with downstream apps [Justin Coyne]
13
+
14
+ 2016-02-12: Add support for customizable Solr request handlers. [Olli Lyytinen]
15
+
16
+ 2016-02-10: Adds SSL options to config (closes #985) [David Chandek-Stark]
17
+
18
+ 2016-02-09: XMLSchema#dateTime requires a colon in the timezone [Justin Coyne]
19
+
20
+ 2016-02-09: Add a rake task for running spec without rubocop [Justin Coyne]
21
+
22
+ 2016-02-09: Use the correct flag to fcrepo_wrapper [Justin Coyne]
23
+
24
+ 2016-02-09: Fixes for rubocop 0.37.1 [Justin Coyne]
25
+
26
+ 2016-02-08: Don't default facet.limit [Justin Coyne]
27
+
28
+ 2016-02-05: Start solr and fedora on a random open port [Justin Coyne]
29
+
1
30
  v9.8.0
2
31
  2016-02-04: Remove unused files [Justin Coyne]
3
32
 
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_development_dependency "equivalent-xml"
35
35
  s.add_development_dependency "simplecov", '~> 0.7.1'
36
36
  s.add_development_dependency "rubocop", '~> 0.34'
37
- s.add_development_dependency "rubocop-rspec", '~> 1.3'
37
+ s.add_development_dependency "rubocop-rspec", '~> 1.3.1'
38
38
 
39
39
  s.files = `git ls-files`.split("\n")
40
40
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
@@ -1,12 +1,12 @@
1
1
  development:
2
2
  user: fedoraAdmin
3
3
  password: fedoraAdmin
4
- url: http://127.0.0.1:8984/rest
4
+ url: http://127.0.0.1:<%= ENV['FCREPO_DEVELOPMENT_PORT'] || 8984 %>/rest
5
5
  base_path: /dev
6
6
  test:
7
7
  user: fedoraAdmin
8
8
  password: fedoraAdmin
9
- url: http://localhost:8986/rest
9
+ url: http://localhost:<%= ENV['FCREPO_TEST_PORT'] || 8986 %>/rest
10
10
  base_path: /test
11
11
  production:
12
12
  user: fedoraAdmin
@@ -1,13 +1,13 @@
1
1
  development:
2
2
  default:
3
- url: http://localhost:8983/solr/hydra-dev
3
+ url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8983 %>/solr/hydra-development
4
4
  full_text:
5
5
  url: http://localhost:8983/solr/development
6
6
  test:
7
7
  default:
8
- url: http://localhost:8985/solr/hydra-test
8
+ url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test
9
9
  full_text:
10
- url: http://localhost:8985/solr/test
10
+ url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/test
11
11
  production:
12
12
  default:
13
13
  url: http://localhost:8080/solr/production
@@ -21,7 +21,7 @@ module RDF
21
21
  ALTERNATIVE_FORMAT = '%Y-%m-%dT%H:%M:%S'.freeze
22
22
  DOT = '.'.freeze
23
23
  EMPTY = ''.freeze
24
- TIMEZONE_FORMAT = '%z'.freeze
24
+ TIMEZONE_FORMAT = '%:z'.freeze
25
25
 
26
26
  def to_s
27
27
  @string ||= begin
@@ -4,11 +4,8 @@ module ActiveFedora::Associations::Builder
4
4
 
5
5
  def validate_options
6
6
  super
7
- if !options[:predicate]
8
- raise "You must specify a predicate for #{name}"
9
- elsif !options[:predicate].is_a?(RDF::URI)
10
- raise ArgumentError, "Predicate must be a kind of RDF::URI"
11
- end
7
+ raise "You must specify a predicate for #{name}" unless options[:predicate]
8
+ raise ArgumentError, "Predicate must be a kind of RDF::URI" unless options[:predicate].is_a?(RDF::URI)
12
9
  end
13
10
  end
14
11
  end
@@ -8,11 +8,8 @@ module ActiveFedora::Associations::Builder
8
8
  def validate_options
9
9
  super
10
10
  Deprecation.warn HasAndBelongsToMany, ":solr_page_size doesn't do anything anymore and will be removed in ActiveFedora 10" if options.key?(:solr_page_size)
11
- if !options[:predicate]
12
- raise "You must specify a predicate for #{name}"
13
- elsif !options[:predicate].is_a?(RDF::URI)
14
- raise ArgumentError, "Predicate must be a kind of RDF::URI"
15
- end
11
+ raise "You must specify a predicate for #{name}" unless options[:predicate]
12
+ raise ArgumentError, "Predicate must be a kind of RDF::URI" unless options[:predicate].is_a?(RDF::URI)
16
13
  end
17
14
  end
18
15
  end
@@ -2,7 +2,7 @@ module ActiveFedora
2
2
  class Config
3
3
  attr_reader :credentials
4
4
  def initialize(val)
5
- @credentials = val.symbolize_keys
5
+ @credentials = val.deep_symbolize_keys
6
6
  return if @credentials.key?(:url)
7
7
  raise ActiveFedora::ConfigurationError, "Fedora configuration must provide :url."
8
8
  end
@@ -21,6 +21,10 @@ module ActiveFedora
21
21
  @config[:password]
22
22
  end
23
23
 
24
+ def ssl_options
25
+ @config[:ssl]
26
+ end
27
+
24
28
  def connection
25
29
  # The InboundRelationConnection does provide more data, useful for
26
30
  # things like ldp:IndirectContainers, but it's imposes a significant
@@ -58,7 +62,9 @@ module ActiveFedora
58
62
  end
59
63
 
60
64
  def authorized_connection
61
- connection = Faraday.new(host)
65
+ options = {}
66
+ options[:ssl] = ssl_options if ssl_options
67
+ connection = Faraday.new(host, options)
62
68
  connection.basic_auth(user, password)
63
69
  connection
64
70
  end
@@ -143,7 +143,8 @@ module ActiveFedora
143
143
 
144
144
  config = solr_yml.symbolize_keys
145
145
  raise "The #{ActiveFedora.environment.to_sym} environment settings were not found in the solr.yml config. If you already have a solr.yml file defined, make sure it defines settings for the #{ActiveFedora.environment.to_sym} environment" unless config[ActiveFedora.environment.to_sym]
146
- @solr_config = { url: solr_url(config[ActiveFedora.environment.to_sym].symbolize_keys) }
146
+ config = config[ActiveFedora.environment.to_sym].symbolize_keys
147
+ @solr_config = { url: solr_url(config) }.merge(config.slice(:update_path, :select_path))
147
148
  end
148
149
 
149
150
  # Given the solr_config that's been loaded for this environment,
@@ -0,0 +1,33 @@
1
+ # Starts a fedora server and a solr server on a random port and then
2
+ # yields the passed block
3
+ def with_test_server(&block)
4
+ with_server('test', &block)
5
+ end
6
+
7
+ def with_server(environment, fcrepo_port: nil, solr_port: nil)
8
+ return yield if ENV["#{environment}_SERVER_STARTED"]
9
+
10
+ ENV["#{environment}_SERVER_STARTED"] = 'true'
11
+
12
+ # setting port: nil assigns a random port.
13
+ solr_params = { port: solr_port, verbose: true, managed: true }
14
+ fcrepo_params = { port: fcrepo_port, verbose: true, managed: true,
15
+ enable_jms: false, fcrepo_home_dir: "fcrepo4-#{environment}-data" }
16
+ SolrWrapper.wrap(solr_params) do |solr|
17
+ ENV["SOLR_#{environment.upcase}_PORT"] = solr.port
18
+ solr_config_path = File.join('solr', 'config')
19
+ # Check to see if configs exist in a path relative to the working directory
20
+ unless Dir.exist?(solr_config_path)
21
+ $stderr.puts "Solr configuration not found at #{solr_config_path}. Using ActiveFedora defaults"
22
+ # Otherwise use the configs delivered with ActiveFedora.
23
+ solr_config_path = File.join(File.expand_path("../..", File.dirname(__FILE__)), "solr", "config")
24
+ end
25
+ solr.with_collection(name: "hydra-#{environment}", dir: solr_config_path) do
26
+ FcrepoWrapper.wrap(fcrepo_params) do |fcrepo|
27
+ ENV["FCREPO_#{environment.upcase}_PORT"] = fcrepo.port
28
+ yield
29
+ end
30
+ end
31
+ end
32
+ ENV["#{environment}_SERVER_STARTED"] = 'false'
33
+ end
@@ -151,11 +151,12 @@ module ActiveFedora
151
151
  opts[:sort] = @klass.default_sort_params unless opts[:sort].present?
152
152
 
153
153
  batch_size = opts.delete(:batch_size) || 1000
154
+ select_path = ActiveFedora::SolrService.select_path
154
155
 
155
156
  counter = 0
156
157
  loop do
157
158
  counter += 1
158
- response = ActiveFedora::SolrService.instance.conn.paginate counter, batch_size, "select", params: opts
159
+ response = ActiveFedora::SolrService.instance.conn.paginate counter, batch_size, select_path, params: opts
159
160
  docs = response["response"]["docs"]
160
161
  yield docs
161
162
  break unless docs.has_next?
@@ -23,11 +23,15 @@ module ActiveFedora
23
23
  Thread.current[:solr_service] = nil
24
24
  end
25
25
 
26
+ def select_path
27
+ ActiveFedora.solr_config.fetch(:select_path, 'select')
28
+ end
29
+
26
30
  def instance
27
31
  # Register Solr
28
32
 
29
33
  unless Thread.current[:solr_service]
30
- register(ActiveFedora.solr_config[:url])
34
+ register(ActiveFedora.solr_config[:url], ActiveFedora.solr_config)
31
35
  end
32
36
 
33
37
  raise SolrNotInitialized unless Thread.current[:solr_service]
@@ -104,7 +108,7 @@ module ActiveFedora
104
108
  def query(query, args = {})
105
109
  raw = args.delete(:raw)
106
110
  args = args.merge(q: query, qt: 'standard')
107
- result = SolrService.instance.conn.get('select', params: args)
111
+ result = SolrService.instance.conn.get(select_path, params: args)
108
112
  return result if raw
109
113
  result['response']['docs']
110
114
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "9.8.2".freeze
2
+ VERSION = "9.9.0".freeze
3
3
  end
@@ -1,12 +1,12 @@
1
1
  development:
2
2
  user: fedoraAdmin
3
3
  password: fedoraAdmin
4
- url: http://127.0.0.1:8984/rest
4
+ url: http://127.0.0.1:<%= ENV['FCREPO_DEVELOPMENT_PORT'] || 8984 %>/rest
5
5
  base_path: /dev
6
6
  test:
7
7
  user: fedoraAdmin
8
8
  password: fedoraAdmin
9
- url: http://localhost:8986/rest
9
+ url: http://127.0.0.1:<%= ENV['FCREPO_TEST_PORT'] || 8986 %>/rest
10
10
  base_path: /test
11
11
  production:
12
12
  user: fedoraAdmin
@@ -1,7 +1,7 @@
1
1
  # This is a sample config file that points to a solr server for each environment
2
2
  development:
3
- url: http://localhost:8983/solr/hydra-dev
3
+ url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8983 %>/solr/hydra-development
4
4
  test:
5
- url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8985}/solr/hydra-test" %>
5
+ url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test
6
6
  production:
7
7
  url: http://your.production.server:8080/bl_solr/core0
@@ -119,9 +119,6 @@
119
119
 
120
120
  <str name="facet">true</str>
121
121
  <str name="facet.mincount">1</str>
122
- <str name="facet.limit">10</str>
123
- <str name="facet.field">active_fedora_model_ssi</str>
124
- <str name="facet.field">subject_sim</str>
125
122
 
126
123
  <str name="spellcheck">true</str>
127
124
  <str name="spellcheck.dictionary">default</str>
@@ -2,6 +2,7 @@ APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../")
2
2
 
3
3
  require 'solr_wrapper'
4
4
  require 'fcrepo_wrapper'
5
+ require 'active_fedora/rake_support'
5
6
 
6
7
  namespace :active_fedora do
7
8
  # Use yard to build docs
@@ -51,24 +52,24 @@ namespace :active_fedora do
51
52
  desc "CI build"
52
53
  task :ci do
53
54
  ENV['environment'] = "test"
54
- solr_params = { port: 8985, verbose: true, managed: true }
55
- fcrepo_params = { port: 8986, verbose: true, managed: true,
56
- no_jms: true, fcrepo_home_dir: 'fcrepo4-test-data' }
57
- SolrWrapper.wrap(solr_params) do |solr|
58
- solr.with_collection(name: 'hydra-test', dir: File.join(File.expand_path("../..", File.dirname(__FILE__)), "solr", "config")) do
59
- FcrepoWrapper.wrap(fcrepo_params) do
60
- Rake::Task['active_fedora:coverage'].invoke
61
- end
62
- end
55
+ with_test_server do
56
+ Rake::Task['active_fedora:rubocop'].invoke unless ENV['NO_RUBOCOP']
57
+ Rake::Task['active_fedora:coverage'].invoke
63
58
  end
64
59
  end
65
60
 
66
61
  desc "Execute specs with coverage"
67
- task coverage: :rubocop do
62
+ task :coverage do
68
63
  # Put spec opts in a file named .rspec in root
69
64
  ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
70
65
  ENV['COVERAGE'] = 'true' unless ruby_engine == 'jruby'
71
- Rake::Task["active_fedora:rspec"].invoke
66
+ Rake::Task["active_fedora:spec"].invoke
72
67
  end
73
68
 
69
+ desc "Execute specs with coverage"
70
+ task :spec do
71
+ with_test_server do
72
+ Rake::Task["active_fedora:rspec"].invoke
73
+ end
74
+ end
74
75
  end
@@ -119,9 +119,6 @@
119
119
 
120
120
  <str name="facet">true</str>
121
121
  <str name="facet.mincount">1</str>
122
- <str name="facet.limit">10</str>
123
- <str name="facet.field">active_fedora_model_ssi</str>
124
- <str name="facet.field">subject_sim</str>
125
122
 
126
123
  <str name="spellcheck">true</str>
127
124
  <str name="spellcheck.dictionary">default</str>
@@ -2,3 +2,11 @@ test:
2
2
  user: fedoraAdmin
3
3
  password: fedoraAdmin
4
4
  url: http://testhost.com:8983/fedora
5
+ test_ssl:
6
+ user: fedoraAdmin
7
+ password: fedoraAdmin
8
+ url: https://testhost.com:8443/fedora
9
+ ssl:
10
+ verify: false
11
+ ca_path: /path/to/certs
12
+
@@ -22,17 +22,28 @@ describe ActiveFedora::Base do
22
22
 
23
23
  let(:date) { DateTime.parse("2015-10-22T10:20:03.653+01:00") }
24
24
  let(:date2) { DateTime.parse("2015-10-22T15:34:20.323-11:00") }
25
- subject { Foo.create(date: [date], single_date: date2, empty_date: '', integer: 1).reload }
26
25
 
27
26
  describe "saving and loading in Fedora" do
27
+ let(:object) { Foo.create!(date: [date], single_date: date2, empty_date: '', integer: 1).reload }
28
28
  it "loads the correct time" do
29
- expect(subject.date.first).to eql date
30
- expect(subject.single_date).to eql date2
29
+ expect(object.date.first).to eql date
30
+ expect(object.single_date).to eql date2
31
+ end
32
+ end
33
+
34
+ describe 'serializing' do
35
+ let(:object) { Foo.new(date: [date]) }
36
+ let(:triple) { object.resource.query(predicate: ::RDF::Vocab::DC.date).to_a.first }
37
+ subject { triple.to_s }
38
+ it 'time zone must have semicolin to be a cannonical XMLSchema#dateTime' do
39
+ expect(subject).to match(/\+01:00/)
31
40
  end
32
41
  end
33
42
 
34
43
  describe "saving and loading in Solr" do
35
- let(:subject_solr) { subject.class.load_instance_from_solr(subject.id) }
44
+ let(:object) { Foo.create!(date: [date], single_date: date2, empty_date: '', integer: 1) }
45
+
46
+ let(:subject_solr) { object.class.load_instance_from_solr(object.id) }
36
47
  it "uses DateTime objects" do
37
48
  expect(subject_solr.date.first).to be_a DateTime
38
49
  expect(subject_solr.single_date).to be_a DateTime
@@ -2,12 +2,17 @@ require 'spec_helper'
2
2
 
3
3
  describe ActiveFedora::Config do
4
4
  context "with a single fedora instance" do
5
- let(:yaml) { Psych.load(File.read('spec/fixtures/rails_root/config/fedora.yml'))['test'] }
6
- let(:conf) { described_class.new(yaml) }
5
+ let(:yaml) { Psych.load(File.read('spec/fixtures/rails_root/config/fedora.yml')) }
6
+ let(:section) { 'test' }
7
+ let(:conf) { described_class.new(yaml[section]) }
7
8
 
8
9
  describe "#credentials" do
9
10
  subject { conf.credentials }
10
- it { should eq(url: 'http://testhost.com:8983/fedora', user: 'fedoraAdmin', password: 'fedoraAdmin') }
11
+ it { is_expected.to eq(url: 'http://testhost.com:8983/fedora', user: 'fedoraAdmin', password: 'fedoraAdmin') }
12
+ describe "with SSL options" do
13
+ let(:section) { 'test_ssl' }
14
+ its([:ssl]) { is_expected.to eq(verify: false, ca_path: '/path/to/certs') }
15
+ end
11
16
  end
12
17
  end
13
18
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActiveFedora::Fedora do
4
+ subject { described_class.new(config) }
5
+ describe "#authorized_connection" do
6
+ describe "with SSL options" do
7
+ let(:config) {
8
+ { url: "https://example.com",
9
+ user: "fedoraAdmin",
10
+ password: "fedoraAdmin",
11
+ ssl: { ca_path: '/path/to/certs' }
12
+ }
13
+ }
14
+ specify {
15
+ expect(Faraday).to receive(:new).with("https://example.com", ssl: { ca_path: '/path/to/certs' }).twice.and_call_original
16
+ subject.authorized_connection
17
+ }
18
+ end
19
+ end
20
+ end
@@ -230,6 +230,15 @@ describe ActiveFedora::FileConfigurator do
230
230
  expect(subject.load_solr_config).to eq(url: "http://mysolr:8081")
231
231
  expect(subject.solr_config).to eq(url: "http://mysolr:8081")
232
232
  end
233
+
234
+ it "includes update_path and select_path in solr_config" do
235
+ allow(subject).to receive(:load_solrizer_config)
236
+ expect(subject).to receive(:config_path).with(:solr).and_return("/path/to/solr.yml")
237
+ expect(subject).to receive(:load_fedora_config)
238
+ expect(IO).to receive(:read).with("/path/to/solr.yml").and_return("test:\n url: http://mysolr:8080\n update_path: update_test\n select_path: select_test\n")
239
+ expect(subject.solr_config[:update_path]).to eq('update_test')
240
+ expect(subject.solr_config[:select_path]).to eq('select_test')
241
+ end
233
242
  end
234
243
 
235
244
  describe "load_configs" do
@@ -6,6 +6,14 @@ describe ActiveFedora::FinderMethods do
6
6
  def self.delegated_attributes
7
7
  {}
8
8
  end
9
+
10
+ def self.solr_query_handler
11
+ 'standard'
12
+ end
13
+
14
+ def self.default_sort_params
15
+ ["system_create_dtsi asc"]
16
+ end
9
17
  end
10
18
  end
11
19
 
@@ -47,4 +55,30 @@ describe ActiveFedora::FinderMethods do
47
55
  "_query_:\"{!raw f=library_id}four\"" }
48
56
  end
49
57
  end
58
+
59
+ describe "#find_in_batches" do
60
+ let(:docs) { double('docs', has_next?: false) }
61
+ let(:select_handler) { 'select' }
62
+ let(:connection) { double('conn') }
63
+ before do
64
+ expect(finder).to receive(:create_query).with('age_t' => '21').and_return('dummy query')
65
+ allow(ActiveFedora::SolrService.instance).to receive(:conn).and_return(connection)
66
+ allow(ActiveFedora::SolrService).to receive(:select_path).and_return(select_handler)
67
+ expect(connection).to receive(:paginate) \
68
+ .with(1, 1000, select_handler, params: hash_including(other_opt: 'test')) \
69
+ .and_return('response' => { 'docs' => docs })
70
+ end
71
+ it "yields the docs" do
72
+ expect { |b|
73
+ finder.find_in_batches({ 'age_t' => '21' }, { other_opt: 'test' }, &b)
74
+ }.to yield_with_args(docs)
75
+ end
76
+
77
+ context "with custom select handler" do
78
+ let(:select_handler) { 'select_test' }
79
+ it "uses the custom select handler" do
80
+ finder.find_in_batches({ 'age_t' => '21' }, other_opt: 'test') do end
81
+ end
82
+ end
83
+ end
50
84
  end
@@ -33,6 +33,13 @@ describe ActiveFedora::SolrService do
33
33
  expect(described_class).to receive(:register)
34
34
  expect(proc { described_class.instance }).to raise_error(ActiveFedora::SolrNotInitialized)
35
35
  end
36
+ it "passes on solr_config when initializing the service" do
37
+ allow(RSolr).to receive(:connect)
38
+ expect(Thread.current[:solr_service]).to be_nil
39
+ allow(ActiveFedora).to receive(:solr_config).and_return(url: 'http://fubar', update_path: 'update_test')
40
+ expect(described_class).to receive(:register).with('http://fubar', hash_including(update_path: 'update_test')).and_call_original
41
+ described_class.instance
42
+ end
36
43
 
37
44
  describe '#construct_query_for_pids' do
38
45
  it "generates a useable solr query from an array of Fedora ids" do
@@ -49,6 +56,14 @@ describe ActiveFedora::SolrService do
49
56
  allow(described_class).to receive(:instance).and_return(double("instance", conn: mock_conn))
50
57
  expect(described_class.query('querytext', raw: true)).to eq stub_result
51
58
  end
59
+ it "uses select_path" do
60
+ mock_conn = double("Connection")
61
+ stub_result = double("Result")
62
+ expect(mock_conn).to receive(:get).with('select_test', params: { q: 'querytext', qt: 'standard' }).and_return(stub_result)
63
+ expect(described_class).to receive(:select_path).and_return('select_test')
64
+ allow(described_class).to receive(:instance).and_return(double("instance", conn: mock_conn))
65
+ expect(described_class.query('querytext', raw: true)).to eq stub_result
66
+ end
52
67
  end
53
68
  describe ".count" do
54
69
  it "returns a count of matching records" do
@@ -66,6 +81,16 @@ describe ActiveFedora::SolrService do
66
81
  expect(described_class.count('querytext', fq: 'filter', rows: 10)).to eq 7
67
82
  end
68
83
  end
84
+ describe ".select_path" do
85
+ it "gets :select_path from solr_config" do
86
+ expect(ActiveFedora).to receive(:solr_config).and_return(select_path: 'select_test')
87
+ expect(described_class.select_path).to eq 'select_test'
88
+ end
89
+ it "uses 'select' as default" do
90
+ expect(ActiveFedora).to receive(:solr_config).and_return({})
91
+ expect(described_class.select_path).to eq 'select'
92
+ end
93
+ end
69
94
 
70
95
  describe ".add" do
71
96
  it "calls solr" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.8.2
4
+ version: 9.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-05 00:00:00.000000000 Z
13
+ date: 2016-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -284,14 +284,14 @@ dependencies:
284
284
  requirements:
285
285
  - - "~>"
286
286
  - !ruby/object:Gem::Version
287
- version: '1.3'
287
+ version: 1.3.1
288
288
  type: :development
289
289
  prerelease: false
290
290
  version_requirements: !ruby/object:Gem::Requirement
291
291
  requirements:
292
292
  - - "~>"
293
293
  - !ruby/object:Gem::Version
294
- version: '1.3'
294
+ version: 1.3.1
295
295
  description: ActiveFedora provides for creating and managing objects in the Fedora
296
296
  Repository Architecture.
297
297
  email:
@@ -431,6 +431,7 @@ files:
431
431
  - lib/active_fedora/query_result_builder.rb
432
432
  - lib/active_fedora/querying.rb
433
433
  - lib/active_fedora/railtie.rb
434
+ - lib/active_fedora/rake_support.rb
434
435
  - lib/active_fedora/rdf.rb
435
436
  - lib/active_fedora/rdf/datastream_indexing.rb
436
437
  - lib/active_fedora/rdf/fcrepo.rb
@@ -610,6 +611,7 @@ files:
610
611
  - spec/unit/core/fedora_id_translator_spec.rb
611
612
  - spec/unit/core/fedora_uri_translator_spec.rb
612
613
  - spec/unit/core_spec.rb
614
+ - spec/unit/fedora_spec.rb
613
615
  - spec/unit/file_configurator_spec.rb
614
616
  - spec/unit/file_path_builder_spec.rb
615
617
  - spec/unit/file_spec.rb