active-fedora 4.0.0.rc14 → 4.0.0.rc15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active-fedora (4.0.0.rc14)
4
+ active-fedora (4.0.0.rc15)
5
5
  activeresource (>= 3.0.0)
6
6
  activesupport (>= 3.0.0)
7
7
  equivalent-xml
@@ -1,4 +1,4 @@
1
- 4.0.0.rc14
1
+ 4.0.0.rc15
2
2
  Removed deprecations
3
3
  * allowing :fedora level in fedora.yml
4
4
  * automatic includes of Relationships and FileMethods is removed
@@ -372,7 +372,7 @@ module ActiveFedora
372
372
  ActiveFedora::Base
373
373
  end
374
374
 
375
- obj = klass.allocate.init_with(SolrDigitalObject.new(solr_doc, self))
375
+ obj = klass.allocate.init_with(SolrDigitalObject.new(solr_doc, klass))
376
376
  #set by default to load any dependent relationship objects from solr as well
377
377
  #need to call rels_ext once so it exists when iterating over datastreams
378
378
  obj.rels_ext
@@ -48,7 +48,6 @@ module ActiveFedora
48
48
  attr_reader :config_options, :fedora_config_path, :solr_config_path
49
49
 
50
50
  # The configuration hash that gets used by RSolr.connect
51
- # @solr_config ||= {}
52
51
  def initialize
53
52
  reset!
54
53
  end
@@ -17,8 +17,9 @@ module ActiveFedora
17
17
  @datastreams = {}
18
18
 
19
19
  dsids = @solr_doc.keys.collect { |k| k.scan(/^(.+)_dsProfile_/).flatten.first }.compact.uniq
20
- missing = dsids-klass.ds_specs.keys
20
+ missing = dsids - klass.ds_specs.keys
21
21
  missing.each do |dsid|
22
+ #Initialize the datastreams that are in the solr document, but not found in the classes spec.
22
23
  mime_key = ActiveFedora::SolrService.solr_name("#{dsid}_dsProfile_dsMIME",:symbol)
23
24
  mime_type = Array(@solr_doc[mime_key]).first
24
25
  ds_class = mime_type =~ /[\/\+]xml$/ ? NokogiriDatastream : Datastream
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "4.0.0.rc14"
2
+ VERSION = "4.0.0.rc15"
3
3
  end
@@ -63,5 +63,11 @@ describe ActiveFedora::Model do
63
63
  subject { ActiveFedora::Base.load_instance_from_solr('hydrangea:fixture_mods_article1') }
64
64
  it { should be_instance_of HydrangeaArticle}
65
65
  end
66
+ describe "with metadata datastrem spec" do
67
+ subject { ActiveFedora::Base.load_instance_from_solr('hydrangea:fixture_mods_article1') }
68
+ it "should create an xml datastream" do
69
+ subject.datastreams['properties'].should be_kind_of ActiveFedora::MetadataDatastream
70
+ end
71
+ end
66
72
  end
67
73
  end
@@ -9,5 +9,6 @@ class HydrangeaArticle < ActiveFedora::Base
9
9
 
10
10
  has_metadata :name => "descMetadata", :type=> Hydra::ModsArticleDatastream
11
11
  has_metadata :name => "rightsMetadata", :type => Hydra::RightsMetadataDatastream
12
+ has_metadata :name => "properties", :type => ActiveFedora::MetadataDatastream
12
13
 
13
14
  end
@@ -1,18 +1,37 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe ActiveFedora::SolrDigitalObject do
4
- subject { ActiveFedora::SolrDigitalObject.new({}) }
5
- describe "when not finished" do
6
- it "should not respond_to? :repository" do
7
- subject.should_not respond_to :repository
4
+ describe "repository" do
5
+ subject { ActiveFedora::SolrDigitalObject.new({}) }
6
+ describe "when not finished" do
7
+ it "should not respond_to? :repository" do
8
+ subject.should_not respond_to :repository
9
+ end
8
10
  end
9
- end
10
- describe "when finished" do
11
- before do
12
- subject.freeze
11
+ describe "when finished" do
12
+ before do
13
+ subject.freeze
14
+ end
15
+ it "should respond_to? :repository" do
16
+ subject.should respond_to :repository
17
+ end
13
18
  end
14
- it "should respond_to? :repository" do
15
- subject.should respond_to :repository
19
+ end
20
+
21
+ describe "initializing" do
22
+ describe "without a datastream in the ds spec and an xml mime type in the solr doc" do
23
+ before do
24
+ class WithoutMetadataDs < ActiveFedora::Base
25
+ ## No datastreams are defined in this class
26
+ end
27
+ end
28
+ after do
29
+ Object.send(:remove_const, :WithoutMetadataDs)
30
+ end
31
+ subject { ActiveFedora::SolrDigitalObject.new({'properties_dsProfile_dsMIME_s' =>'text/xml'}, WithoutMetadataDs) }
32
+ it "should create an xml datastream" do
33
+ subject.datastreams['properties'].should be_kind_of ActiveFedora::NokogiriDatastream
34
+ end
16
35
  end
17
36
  end
18
37
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424137
4
+ hash: 15424139
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 4
8
8
  - 0
9
9
  - 0
10
10
  - rc
11
- - 14
12
- version: 4.0.0.rc14
11
+ - 15
12
+ version: 4.0.0.rc15
13
13
  platform: ruby
14
14
  authors:
15
15
  - Matt Zumwalt