active-fedora 6.0.0.rc5 → 6.0.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/active-fedora.gemspec +1 -1
- data/lib/active_fedora/datastream_hash.rb +1 -1
- data/lib/active_fedora/datastreams.rb +1 -1
- data/lib/active_fedora/nom_datastream.rb +1 -1
- data/lib/active_fedora/om_datastream.rb +5 -6
- data/lib/active_fedora/rels_ext_datastream.rb +2 -2
- data/lib/active_fedora/version.rb +1 -1
- data/lib/tasks/active_fedora_dev.rake +0 -32
- data/spec/integration/bug_spec.rb +11 -26
- data/spec/integration/om_datastream_spec.rb +121 -101
- data/spec/unit/datastreams_spec.rb +4 -3
- data/spec/unit/nom_datastream_spec.rb +5 -1
- data/spec/unit/om_datastream_spec.rb +3 -4
- data/spec/unit/rels_ext_datastream_spec.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9409f2deb359a4478e64508db0a9e1efeddd3ede
|
4
|
+
data.tar.gz: 24abcbc60267a4dc7d119ea21e02bdf792f12b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3447788f7c5fbe82a19d97bee6f6c4b8fbef4811738e3555f9c853d18e0e77f8b3acc1114d342f27177d9b65ecfde8e45818568337d82cd4856bb145b42f029
|
7
|
+
data.tar.gz: 0e0471d596cd79f882e9face2f5f70c6a93ff72ce19e6759e081c79d7db2575354f1b74aa044ea7f807857c8af6455b1a05fa2c4f204ea8af9b76a30236fac5e
|
data/active-fedora.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_development_dependency("yard")
|
32
32
|
s.add_development_dependency("RedCloth") # for RDoc formatting
|
33
33
|
s.add_development_dependency("rake")
|
34
|
-
s.add_development_dependency("jettywrapper", ">=1.
|
34
|
+
s.add_development_dependency("jettywrapper", ">=1.4.0")
|
35
35
|
s.add_development_dependency("rspec", ">= 2.9.0")
|
36
36
|
s.add_development_dependency("equivalent-xml")
|
37
37
|
s.add_development_dependency("rest-client")
|
@@ -4,7 +4,7 @@ module ActiveFedora
|
|
4
4
|
|
5
5
|
included do
|
6
6
|
class_attribute :ds_specs
|
7
|
-
self.ds_specs = {'RELS-EXT'=> {:type=> ActiveFedora::RelsExtDatastream, :label=>"Fedora Object-to-Object Relationship Metadata", :
|
7
|
+
self.ds_specs = {'RELS-EXT'=> {:type=> ActiveFedora::RelsExtDatastream, :label=>"Fedora Object-to-Object Relationship Metadata", :block=>nil}}
|
8
8
|
class << self
|
9
9
|
def inherited_with_datastreams(kls) #:nodoc:
|
10
10
|
## Do some inheritance logic that doesn't override Base.inherited
|
@@ -10,7 +10,7 @@ module ActiveFedora
|
|
10
10
|
false
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
include OM::XML::Document
|
15
15
|
include OM::XML::TerminologyBasedSolrizer # this adds support for calling .to_solr
|
16
16
|
|
@@ -20,7 +20,7 @@ module ActiveFedora
|
|
20
20
|
attr_accessor :internal_solr_doc
|
21
21
|
|
22
22
|
def self.default_attributes
|
23
|
-
super.merge(:controlGroup => '
|
23
|
+
super.merge(:controlGroup => 'M', :mimeType => 'text/xml')
|
24
24
|
end
|
25
25
|
|
26
26
|
# Create an instance of this class based on xml content
|
@@ -95,10 +95,9 @@ module ActiveFedora
|
|
95
95
|
true
|
96
96
|
end
|
97
97
|
|
98
|
-
def
|
99
|
-
|
100
|
-
|
101
|
-
val unless val == "<?xml version=\"1.0\"?>\n"
|
98
|
+
def local_or_remote_content(ensure_fetch = true)
|
99
|
+
@content = to_xml if ng_xml_changed? || autocreate?
|
100
|
+
super
|
102
101
|
end
|
103
102
|
|
104
103
|
def autocreate?
|
@@ -2,38 +2,6 @@ APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../")
|
|
2
2
|
|
3
3
|
require 'jettywrapper'
|
4
4
|
|
5
|
-
namespace :jetty do
|
6
|
-
JETTY_URL = 'https://github.com/projecthydra/hydra-jetty/archive/new-solr-schema.zip'
|
7
|
-
JETTY_ZIP = File.join 'tmp', JETTY_URL.split('/').last
|
8
|
-
JETTY_DIR = 'jetty'
|
9
|
-
|
10
|
-
desc "download the jetty zip file"
|
11
|
-
task :download do
|
12
|
-
system 'mkdir tmp' unless File.directory? 'tmp'
|
13
|
-
puts "Downloading jetty..."
|
14
|
-
system "curl -L #{JETTY_URL} -o #{JETTY_ZIP}"
|
15
|
-
abort "Unable to download jetty from #{JETTY_URL}" unless $?.success?
|
16
|
-
end
|
17
|
-
|
18
|
-
task :unzip do
|
19
|
-
Rake::Task["jetty:download"].invoke unless File.exists? JETTY_ZIP
|
20
|
-
puts "Unpacking jetty..."
|
21
|
-
tmp_save_dir = File.join 'tmp', 'jetty_generator'
|
22
|
-
system "unzip -d #{tmp_save_dir} -qo #{JETTY_ZIP}"
|
23
|
-
abort "Unable to unzip #{JETTY_ZIP} into tmp_save_dir/" unless $?.success?
|
24
|
-
|
25
|
-
expanded_dir = Dir[File.join(tmp_save_dir, "hydra-jetty-*")].first
|
26
|
-
|
27
|
-
system "mv #{expanded_dir} #{JETTY_DIR}"
|
28
|
-
abort "Unable to move #{expanded_dir} into #{JETTY_DIR}/" unless $?.success?
|
29
|
-
end
|
30
|
-
|
31
|
-
task :clean do
|
32
|
-
system "rm -rf #{JETTY_DIR}"
|
33
|
-
Rake::Task["jetty:unzip"].invoke
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
5
|
namespace :active_fedora do
|
38
6
|
require 'active-fedora'
|
39
7
|
|
@@ -6,46 +6,31 @@ require "rexml/document"
|
|
6
6
|
include ActiveFedora::Model
|
7
7
|
|
8
8
|
describe 'bugs' do
|
9
|
-
before
|
9
|
+
before do
|
10
10
|
class FooHistory < ActiveFedora::Base
|
11
11
|
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"someData" do |m|
|
12
12
|
m.field "fubar", :string
|
13
|
-
m.field "swank", :text
|
14
|
-
end
|
15
|
-
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"withText" do |m|
|
16
|
-
m.field "fubar", :text
|
17
13
|
end
|
18
14
|
end
|
19
|
-
end
|
20
|
-
after :all do
|
21
|
-
Object.send(:remove_const, :FooHistory)
|
22
|
-
end
|
23
|
-
|
24
|
-
before(:each) do
|
25
15
|
@test_object = FooHistory.new
|
26
16
|
@test_object.save
|
27
17
|
end
|
28
|
-
after
|
18
|
+
after do
|
29
19
|
@test_object.delete
|
20
|
+
Object.send(:remove_const, :FooHistory)
|
30
21
|
end
|
31
|
-
it "should not clobber everything when setting a value" do
|
32
|
-
ds = @test_object.datastreams["someData"]
|
33
|
-
ds.fubar.should == []
|
34
|
-
ds.should_not be_nil
|
35
|
-
ds.fubar=['bar']
|
36
|
-
ds.fubar.should == ['bar']
|
37
|
-
@test_object.save
|
38
22
|
|
39
|
-
|
23
|
+
it "should not clobber everything when setting a value" do
|
24
|
+
@test_object.someData.fubar=['initial']
|
25
|
+
@test_object.save!
|
40
26
|
|
41
27
|
x = FooHistory.find(@test_object.pid)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
x.save
|
28
|
+
x.someData.fubar = ["replacement"] # set a new value
|
29
|
+
x.save!
|
30
|
+
|
31
|
+
|
47
32
|
x = FooHistory.find(@test_object.pid)
|
48
|
-
x.
|
33
|
+
x.someData.fubar.should == ["replacement"] # recall the value
|
49
34
|
x.save
|
50
35
|
end
|
51
36
|
end
|
@@ -3,31 +3,21 @@ require "solrizer"
|
|
3
3
|
|
4
4
|
describe ActiveFedora::OmDatastream do
|
5
5
|
|
6
|
-
before(:all) do
|
7
|
-
class HydrangeaArticle2 < ActiveFedora::Base
|
8
|
-
# Uses the Hydra MODS Article profile for tracking most of the descriptive metadata
|
9
|
-
has_metadata :name => "descMetadata", :type => Hydra::ModsArticleDatastream
|
10
|
-
|
11
|
-
# A place to put extra metadata values
|
12
|
-
has_metadata :name => "properties", :type => ActiveFedora::SimpleDatastream do |m|
|
13
|
-
m.field 'collection', :string
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
after(:all) do
|
20
|
-
Object.send(:remove_const, :HydrangeaArticle2)
|
21
|
-
end
|
22
|
-
|
23
6
|
describe "an new instance with a inline datastream" do
|
24
7
|
before do
|
25
|
-
|
8
|
+
class HydrangeaArticle3 < ActiveFedora::Base
|
9
|
+
# Uses the Hydra MODS Article profile for tracking most of the descriptive metadata
|
10
|
+
has_metadata :name => "descMetadata", :type => Hydra::ModsArticleDatastream, :control_group => 'X'
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
@obj = HydrangeaArticle3.new
|
26
15
|
@obj.save
|
27
16
|
@obj.descMetadata.should be_inline
|
28
17
|
end
|
29
18
|
after do
|
30
19
|
@obj.destroy
|
20
|
+
Object.send(:remove_const, :HydrangeaArticle3)
|
31
21
|
end
|
32
22
|
it "should not be changed when no fields have been set" do
|
33
23
|
@obj.descMetadata.should_not be_content_changed
|
@@ -36,108 +26,138 @@ describe ActiveFedora::OmDatastream do
|
|
36
26
|
@obj.descMetadata.title = 'Foobar'
|
37
27
|
@obj.descMetadata.should be_content_changed
|
38
28
|
end
|
39
|
-
|
29
|
+
describe "#changed?" do
|
30
|
+
it "should not be changed if the new xml matches the old xml" do
|
31
|
+
@pid = "hydrangea:fixture_mods_article2"
|
32
|
+
@test_object = HydrangeaArticle3.find(@pid)
|
40
33
|
|
34
|
+
@test_object.descMetadata.ng_xml = @test_object.descMetadata.ng_xml
|
35
|
+
@test_object.descMetadata.should_not be_changed
|
36
|
+
end
|
41
37
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
it "should not be changed if there are minor differences in whitespace" do
|
39
|
+
obj = HydrangeaArticle3.new
|
40
|
+
obj.descMetadata.content = "<a>1</a>"
|
41
|
+
obj.save
|
42
|
+
obj.descMetadata.should_not be_changed
|
43
|
+
obj.descMetadata.content = "<a>1</a>\n"
|
44
|
+
obj.descMetadata.should_not be_changed
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
+
|
50
|
+
describe "an instance that is a managed datastream" do
|
51
|
+
before(:all) do
|
52
|
+
class HydrangeaArticle2 < ActiveFedora::Base
|
53
|
+
# Uses the Hydra MODS Article profile for tracking most of the descriptive metadata
|
54
|
+
has_metadata :name => "descMetadata", :type => Hydra::ModsArticleDatastream
|
55
|
+
end
|
49
56
|
end
|
50
57
|
|
58
|
+
after(:all) do
|
59
|
+
Object.send(:remove_const, :HydrangeaArticle2)
|
60
|
+
end
|
51
61
|
|
52
|
-
|
62
|
+
describe "#changed?" do
|
63
|
+
it "should not be changed if the new xml matches the old xml" do
|
64
|
+
@pid = "hydrangea:fixture_mods_article2"
|
65
|
+
@test_object = HydrangeaArticle2.find(@pid)
|
53
66
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
obj.descMetadata.should_not be_changed
|
58
|
-
obj.descMetadata.content = "<a>1</a>\n"
|
59
|
-
obj.descMetadata.should_not be_changed
|
67
|
+
@test_object.descMetadata.ng_xml = @test_object.descMetadata.ng_xml
|
68
|
+
@test_object.descMetadata.should_not be_changed
|
69
|
+
end
|
60
70
|
|
71
|
+
it "should be changed if there are minor differences in whitespace" do
|
72
|
+
obj = HydrangeaArticle2.new
|
73
|
+
obj.descMetadata.content = "<a>1</a>"
|
74
|
+
obj.save
|
75
|
+
obj.descMetadata.should_not be_changed
|
76
|
+
obj.descMetadata.content = "<a>1</a>\n"
|
77
|
+
obj.descMetadata.should be_changed
|
78
|
+
end
|
61
79
|
end
|
62
|
-
end
|
63
80
|
|
64
|
-
describe "empty datastream content" do
|
65
|
-
it "should not break when there is empty datastream content" do
|
66
|
-
obj = HydrangeaArticle2.new
|
67
|
-
obj.descMetadata.content = ""
|
68
|
-
obj.save
|
69
81
|
|
70
|
-
end
|
71
|
-
end
|
72
82
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
@test_object.save
|
79
|
-
@test_object = HydrangeaArticle2.find(@pid)
|
80
|
-
@test_solr_object = ActiveFedora::Base.load_instance_from_solr(@pid)
|
81
|
-
end
|
83
|
+
describe "empty datastream content" do
|
84
|
+
it "should not break when there is empty datastream content" do
|
85
|
+
obj = HydrangeaArticle2.new
|
86
|
+
obj.descMetadata.content = ""
|
87
|
+
obj.save
|
82
88
|
|
83
|
-
|
84
|
-
@test_solr_object.datastreams["descMetadata"].term_values(:name,:role,:text).should == ["Creator","Contributor","Funder","Host"]
|
85
|
-
@test_solr_object.datastreams["descMetadata"].term_values({:name=>0},:role,:text).should == ["Creator"]
|
86
|
-
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},:role,:text).should == ["Contributor"]
|
87
|
-
@test_solr_object.datastreams["descMetadata"].term_values({:name=>0},{:role=>0},:text).should == ["Creator"]
|
88
|
-
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>0},:text).should == ["Contributor"]
|
89
|
-
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>1},:text).should == []
|
90
|
-
ar = @test_solr_object.datastreams["descMetadata"].term_values(:name,{:role=>0},:text)
|
91
|
-
ar.length.should == 4
|
92
|
-
ar.include?("Creator").should == true
|
93
|
-
ar.include?("Contributor").should == true
|
94
|
-
ar.include?("Funder").should == true
|
95
|
-
ar.include?("Host").should == true
|
96
|
-
|
97
|
-
@test_object.datastreams["descMetadata"].term_values(:name,:role,:text).should == ["Creator","Contributor","Funder","Host"]
|
98
|
-
@test_object.datastreams["descMetadata"].term_values({:name=>0},:role,:text).should == ["Creator"]
|
99
|
-
@test_object.datastreams["descMetadata"].term_values({:name=>1},:role,:text).should == ["Contributor"]
|
100
|
-
@test_object.datastreams["descMetadata"].term_values({:name=>0},{:role=>0},:text).should == ["Creator"]
|
101
|
-
@test_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>0},:text).should == ["Contributor"]
|
102
|
-
@test_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>1},:text).should == []
|
103
|
-
ar = @test_object.datastreams["descMetadata"].term_values(:name,{:role=>0},:text)
|
104
|
-
ar.length.should == 4
|
105
|
-
ar.include?("Creator").should == true
|
106
|
-
ar.include?("Contributor").should == true
|
107
|
-
ar.include?("Funder").should == true
|
108
|
-
ar.include?("Host").should == true
|
89
|
+
end
|
109
90
|
end
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
91
|
+
|
92
|
+
describe '.term_values' do
|
93
|
+
before do
|
94
|
+
@pid = "hydrangea:fixture_mods_article2"
|
95
|
+
@test_object = HydrangeaArticle2.find(@pid)
|
96
|
+
@test_object.descMetadata.content = File.read(fixture('mods_articles/hydrangea_article1.xml'))
|
97
|
+
@test_object.save
|
98
|
+
@test_object = HydrangeaArticle2.find(@pid)
|
99
|
+
@test_solr_object = ActiveFedora::Base.load_instance_from_solr(@pid)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should return the same values whether getting from solr or Fedora" do
|
103
|
+
@test_solr_object.datastreams["descMetadata"].term_values(:name,:role,:text).should == ["Creator","Contributor","Funder","Host"]
|
104
|
+
@test_solr_object.datastreams["descMetadata"].term_values({:name=>0},:role,:text).should == ["Creator"]
|
105
|
+
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},:role,:text).should == ["Contributor"]
|
106
|
+
@test_solr_object.datastreams["descMetadata"].term_values({:name=>0},{:role=>0},:text).should == ["Creator"]
|
107
|
+
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>0},:text).should == ["Contributor"]
|
108
|
+
@test_solr_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>1},:text).should == []
|
109
|
+
ar = @test_solr_object.datastreams["descMetadata"].term_values(:name,{:role=>0},:text)
|
110
|
+
ar.length.should == 4
|
111
|
+
ar.include?("Creator").should == true
|
112
|
+
ar.include?("Contributor").should == true
|
113
|
+
ar.include?("Funder").should == true
|
114
|
+
ar.include?("Host").should == true
|
115
|
+
|
116
|
+
@test_object.datastreams["descMetadata"].term_values(:name,:role,:text).should == ["Creator","Contributor","Funder","Host"]
|
117
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>0},:role,:text).should == ["Creator"]
|
118
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>1},:role,:text).should == ["Contributor"]
|
119
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>0},{:role=>0},:text).should == ["Creator"]
|
120
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>0},:text).should == ["Contributor"]
|
121
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>1},{:role=>1},:text).should == []
|
122
|
+
ar = @test_object.datastreams["descMetadata"].term_values(:name,{:role=>0},:text)
|
123
|
+
ar.length.should == 4
|
124
|
+
ar.include?("Creator").should == true
|
125
|
+
ar.include?("Contributor").should == true
|
126
|
+
ar.include?("Funder").should == true
|
127
|
+
ar.include?("Host").should == true
|
128
|
+
end
|
119
129
|
end
|
130
|
+
|
131
|
+
describe '.update_values' do
|
132
|
+
before do
|
133
|
+
@pid = "hydrangea:fixture_mods_article2"
|
134
|
+
@test_object = HydrangeaArticle2.find(@pid)
|
135
|
+
@test_object.descMetadata.content = File.read(fixture('mods_articles/hydrangea_article1.xml'))
|
136
|
+
@test_object.save
|
137
|
+
@test_object = HydrangeaArticle2.find(@pid)
|
138
|
+
end
|
120
139
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
140
|
+
it "should not be dirty after .update_values is saved" do
|
141
|
+
@test_object.datastreams["descMetadata"].update_values([{:name=>0},{:role=>0},:text] =>"Funder")
|
142
|
+
@test_object.datastreams["descMetadata"].should be_changed
|
143
|
+
@test_object.save
|
144
|
+
@test_object.datastreams["descMetadata"].should_not be_changed
|
145
|
+
@test_object.datastreams["descMetadata"].term_values({:name=>0},{:role=>0},:text).should == ["Funder"]
|
146
|
+
end
|
147
|
+
end
|
129
148
|
|
130
149
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
150
|
+
describe ".to_solr" do
|
151
|
+
before do
|
152
|
+
object = HydrangeaArticle2.new
|
153
|
+
object.descMetadata.journal.issue.publication_date = Date.parse('2012-11-02')
|
154
|
+
object.save!
|
155
|
+
@test_object = HydrangeaArticle2.find(object.pid)
|
137
156
|
|
138
|
-
|
139
|
-
|
140
|
-
|
157
|
+
end
|
158
|
+
it "should solrize terms with :type=>'date' to *_dt solr terms" do
|
159
|
+
@test_object.to_solr[ActiveFedora::SolrService.solr_name('mods_journal_issue_publication_date', type: :date)].should == ['2012-11-02T00:00:00Z']
|
160
|
+
end
|
141
161
|
end
|
142
162
|
end
|
143
163
|
end
|
@@ -177,9 +177,10 @@ describe ActiveFedora::Datastreams do
|
|
177
177
|
|
178
178
|
describe "#dc" do
|
179
179
|
it "should be the DC datastream" do
|
180
|
-
|
181
|
-
|
182
|
-
|
180
|
+
subject.dc.should be_kind_of ActiveFedora::Datastream
|
181
|
+
end
|
182
|
+
it "should be an inline datastream" do
|
183
|
+
subject.dc.controlGroup.should == 'X'
|
183
184
|
end
|
184
185
|
end
|
185
186
|
|
@@ -22,6 +22,10 @@ describe ActiveFedora::NomDatastream do
|
|
22
22
|
subject.to_solr['a_s'].should include('123')
|
23
23
|
subject.to_solr['b_s'].should include('asdf')
|
24
24
|
end
|
25
|
+
|
26
|
+
it "should be a managed datastream" do
|
27
|
+
subject.controlGroup.should == 'M'
|
28
|
+
end
|
25
29
|
end
|
26
30
|
|
27
31
|
describe "with options for .set_terminology" do
|
@@ -54,4 +58,4 @@ describe ActiveFedora::NomDatastream do
|
|
54
58
|
end
|
55
59
|
|
56
60
|
end
|
57
|
-
end
|
61
|
+
end
|
@@ -31,11 +31,10 @@ describe ActiveFedora::OmDatastream do
|
|
31
31
|
@test_ds.stub(:new? => false)
|
32
32
|
end
|
33
33
|
|
34
|
-
after(:each) do
|
35
|
-
end
|
36
|
-
|
37
34
|
its(:metadata?) { should be_true}
|
38
35
|
|
36
|
+
its(:controlGroup) { should == "M"}
|
37
|
+
|
39
38
|
it "should include the Solrizer::XML::TerminologyBasedSolrizer for .to_solr support" do
|
40
39
|
ActiveFedora::OmDatastream.included_modules.should include(OM::XML::TerminologyBasedSolrizer)
|
41
40
|
end
|
@@ -175,7 +174,7 @@ describe ActiveFedora::OmDatastream do
|
|
175
174
|
@test_ds.stub(:new? => true)
|
176
175
|
@test_ds.stub(:ng_xml_changed? => true)
|
177
176
|
@test_ds.stub(:to_xml => "fake xml")
|
178
|
-
@mock_repo.should_receive(:add_datastream).with(:pid => nil, :dsid => 'descMetadata', :versionable => true, :content => 'fake xml', :controlGroup => '
|
177
|
+
@mock_repo.should_receive(:add_datastream).with(:pid => nil, :dsid => 'descMetadata', :versionable => true, :content => 'fake xml', :controlGroup => 'M', :dsState => 'A', :mimeType=>'text/xml')
|
179
178
|
|
180
179
|
@test_ds.serialize!
|
181
180
|
@test_ds.save
|
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: 6.0.0.
|
4
|
+
version: 6.0.0.rc6
|
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: 2013-03-
|
13
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -242,14 +242,14 @@ dependencies:
|
|
242
242
|
requirements:
|
243
243
|
- - '>='
|
244
244
|
- !ruby/object:Gem::Version
|
245
|
-
version: 1.
|
245
|
+
version: 1.4.0
|
246
246
|
type: :development
|
247
247
|
prerelease: false
|
248
248
|
version_requirements: !ruby/object:Gem::Requirement
|
249
249
|
requirements:
|
250
250
|
- - '>='
|
251
251
|
- !ruby/object:Gem::Version
|
252
|
-
version: 1.
|
252
|
+
version: 1.4.0
|
253
253
|
- !ruby/object:Gem::Dependency
|
254
254
|
name: rspec
|
255
255
|
requirement: !ruby/object:Gem::Requirement
|