active-fedora 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +14 -1
- data/README.textile +6 -0
- data/active-fedora.gemspec +1 -1
- data/lib/active_fedora.rb +2 -0
- data/lib/active_fedora/associations.rb +22 -2
- data/lib/active_fedora/associations/association_collection.rb +37 -0
- data/lib/active_fedora/associations/belongs_to_association.rb +8 -0
- data/lib/active_fedora/associations/has_many_association.rb +2 -0
- data/lib/active_fedora/base.rb +43 -6
- data/lib/active_fedora/datastream.rb +13 -37
- data/lib/active_fedora/datastreams.rb +2 -6
- data/lib/active_fedora/digital_object.rb +8 -1
- data/lib/active_fedora/metadata_datastream_helper.rb +2 -2
- data/lib/active_fedora/nokogiri_datastream.rb +55 -16
- data/lib/active_fedora/persistence.rb +14 -9
- data/lib/active_fedora/railtie.rb +15 -0
- data/lib/active_fedora/rdf_datastream.rb +4 -0
- data/lib/active_fedora/rdfxml_rdf_datastream.rb +2 -6
- data/lib/active_fedora/reflection.rb +11 -0
- data/lib/active_fedora/relationships.rb +4 -4
- data/lib/active_fedora/rels_ext_datastream.rb +21 -6
- data/lib/active_fedora/semantic_node.rb +3 -3
- data/lib/active_fedora/test_support.rb +38 -0
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/USAGE +9 -0
- data/lib/generators/active_fedora/config/config_generator.rb +10 -0
- data/lib/generators/active_fedora/config/fedora/fedora_generator.rb +12 -0
- data/lib/generators/active_fedora/config/fedora/templates/fedora.yml +14 -0
- data/lib/generators/active_fedora/config/fedora/templates/fedora_conf/conf/development/fedora.fcfg +953 -0
- data/lib/generators/active_fedora/config/fedora/templates/fedora_conf/conf/test/fedora.fcfg +953 -0
- data/lib/generators/active_fedora/config/solr/solr_generator.rb +12 -0
- data/lib/generators/active_fedora/config/solr/templates/solr.yml +10 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_conf/conf/schema.xml +692 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_conf/conf/solrconfig.xml +299 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_conf/solr.xml +35 -0
- data/lib/generators/active_fedora/model/USAGE +9 -0
- data/lib/generators/active_fedora/model/model_generator.rb +21 -0
- data/lib/generators/active_fedora/model/templates/model.rb.erb +6 -0
- data/lib/generators/active_fedora/model/templates/model_spec.rb.erb +21 -0
- data/lib/tasks/active_fedora_dev.rake +8 -0
- data/spec/fixtures/hydrangea_fixture_mods_article2.foxml.xml +234 -0
- data/spec/integration/associations_spec.rb +76 -15
- data/spec/integration/base_spec.rb +38 -10
- data/spec/integration/datastreams_spec.rb +24 -2
- data/spec/integration/nokogiri_datastream_spec.rb +23 -5
- data/spec/unit/base_extra_spec.rb +0 -1
- data/spec/unit/base_spec.rb +7 -47
- data/spec/unit/datastream_collections_spec.rb +0 -7
- data/spec/unit/datastream_spec.rb +7 -16
- data/spec/unit/datastreams_spec.rb +2 -2
- data/spec/unit/nokogiri_datastream_spec.rb +31 -20
- data/spec/unit/ntriples_datastream_spec.rb +7 -10
- data/spec/unit/persistence_spec.rb +0 -11
- data/spec/unit/qualified_dublin_core_datastream_spec.rb +1 -2
- data/spec/unit/relationships_spec.rb +5 -5
- data/spec/unit/rels_ext_datastream_spec.rb +14 -9
- data/spec/unit/semantic_node_spec.rb +4 -4
- metadata +25 -6
@@ -19,7 +19,7 @@ describe ActiveFedora::Datastream do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should be inspectable" do
|
22
|
-
@test_datastream.inspect.should match /#<ActiveFedora::Datastream:-?\d+ @pid=\"__DO_NOT_USE__\" @dsid=\"abcd\" @controlGroup=\"M\"
|
22
|
+
@test_datastream.inspect.should match /#<ActiveFedora::Datastream:-?\d+ @pid=\"__DO_NOT_USE__\" @dsid=\"abcd\" @controlGroup=\"M\" changed=\"true\" @mimeType=\"\" >/
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#validate_content_present' do
|
@@ -62,14 +62,14 @@ describe ActiveFedora::Datastream do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
describe '#save' do
|
65
|
-
it "should set
|
66
|
-
mock_repo = mock('repository'
|
67
|
-
mock_repo.stubs(:
|
68
|
-
mock_repo.
|
65
|
+
it "should set changed" do
|
66
|
+
mock_repo = mock('repository')
|
67
|
+
mock_repo.stubs(:config).returns({})
|
68
|
+
mock_repo.stubs(:add_datastream).with(:versionable => true, :pid => @test_object.pid, :dsid => 'abcd', :controlGroup => 'M', :dsState => 'A', :content => 'hi there')
|
69
|
+
mock_repo.expects(:datastream).with(:dsid => 'abcd', :pid => @test_object.pid).returns('').at_least_once
|
69
70
|
@test_object.inner_object.stubs(:repository).returns(mock_repo)
|
70
|
-
@test_datastream.dirty?.should be_true
|
71
71
|
@test_datastream.save
|
72
|
-
@test_datastream.
|
72
|
+
@test_datastream.should_not be_changed
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -85,15 +85,6 @@ describe ActiveFedora::Datastream do
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
describe ".dirty?" do
|
89
|
-
it "should return the value of the @dirty attribute or changed?" do
|
90
|
-
@test_datastream.instance_variable_get(:@changed_attributes).clear
|
91
|
-
@test_datastream.dirty?.should be_false
|
92
|
-
@test_datastream.dirty = "boo"
|
93
|
-
@test_datastream.dirty?.should be_true
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
88
|
it "should have mimeType accessors" do
|
98
89
|
ds1 = ActiveFedora::Datastream.new
|
99
90
|
ds1.mimeType = "text/foo"
|
@@ -98,11 +98,11 @@ describe ActiveFedora::Datastreams do
|
|
98
98
|
describe "creates datastreams" do
|
99
99
|
before(:each) do
|
100
100
|
class FooHistory < ActiveFedora::Base
|
101
|
-
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"someData" do |m|
|
101
|
+
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"someData", :autocreate => true do |m|
|
102
102
|
m.field "fubar", :string
|
103
103
|
m.field "swank", :text
|
104
104
|
end
|
105
|
-
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"withText2", :label=>"withLabel" do |m|
|
105
|
+
has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"withText2", :label=>"withLabel", :autocreate => true do |m|
|
106
106
|
m.field "fubar", :text
|
107
107
|
end
|
108
108
|
|
@@ -18,7 +18,9 @@ describe ActiveFedora::NokogiriDatastream do
|
|
18
18
|
@mock_repo.stubs(:datastream_dissemination=>'My Content', :config=>{})
|
19
19
|
@mock_inner.stubs(:repository).returns(@mock_repo)
|
20
20
|
@mock_inner.stubs(:pid)
|
21
|
+
@mock_inner.stubs(:new? => false)
|
21
22
|
@test_ds = ActiveFedora::NokogiriDatastream.new(@mock_inner, "descMetadata")
|
23
|
+
@test_ds.stubs(:new? => false, :profile => {}, :datastream_content => '<test_xml/>')
|
22
24
|
@test_ds.content="<test_xml/>"
|
23
25
|
end
|
24
26
|
|
@@ -44,7 +46,6 @@ describe ActiveFedora::NokogiriDatastream do
|
|
44
46
|
it "should initialize from #xml_template if no xml is provided" do
|
45
47
|
ActiveFedora::NokogiriDatastream.expects(:xml_template).returns("<fake template/>")
|
46
48
|
n = ActiveFedora::NokogiriDatastream.new
|
47
|
-
n.ensure_xml_loaded
|
48
49
|
n.ng_xml.should be_equivalent_to("<fake template/>")
|
49
50
|
end
|
50
51
|
end
|
@@ -133,10 +134,10 @@ describe ActiveFedora::NokogiriDatastream do
|
|
133
134
|
# @test_ds.fubar_values.should == ["val1", "val2"]
|
134
135
|
# end
|
135
136
|
|
136
|
-
it "should set
|
137
|
+
it "should set changed to true" do
|
137
138
|
@mods_ds.get_values([{:title_info=>0},:main_title]).should == ["ARTICLE TITLE", "TITLE OF HOST JOURNAL"]
|
138
139
|
@mods_ds.update_indexed_attributes [{"title_info"=>"0"},"main_title"]=>{"-1"=>"mork"}
|
139
|
-
@mods_ds.
|
140
|
+
@mods_ds.should be_changed
|
140
141
|
end
|
141
142
|
end
|
142
143
|
|
@@ -163,7 +164,7 @@ describe ActiveFedora::NokogiriDatastream do
|
|
163
164
|
mods_xml = Nokogiri::XML::Document.parse( fixture(File.join("mods_articles", "hydrangea_article1.xml")) )
|
164
165
|
tmpl = Hydra::ModsArticleDatastream.new
|
165
166
|
Hydra::ModsArticleDatastream.from_xml(mods_xml,tmpl).ng_xml.root.to_xml.should == mods_xml.root.to_xml
|
166
|
-
tmpl.
|
167
|
+
tmpl.should_not be_changed
|
167
168
|
end
|
168
169
|
end
|
169
170
|
|
@@ -177,10 +178,10 @@ describe ActiveFedora::NokogiriDatastream do
|
|
177
178
|
@test_ds.should respond_to(:save)
|
178
179
|
end
|
179
180
|
it "should persist the product of .to_xml in fedora" do
|
180
|
-
@test_ds.expects(:new?).returns(true).
|
181
|
-
@
|
181
|
+
@test_ds.expects(:new?).returns(true).at_least_once
|
182
|
+
@test_ds.stubs(:to_xml => "fake xml")
|
182
183
|
@mock_repo.expects(:add_datastream).with(:pid => nil, :dsid => 'descMetadata', :versionable => true, :content => 'fake xml', :controlGroup => 'X', :dsState => 'A', :mimeType=>'text/xml')
|
183
|
-
|
184
|
+
|
184
185
|
@test_ds.serialize!
|
185
186
|
@test_ds.save
|
186
187
|
@test_ds.mimeType.should == 'text/xml'
|
@@ -188,14 +189,24 @@ describe ActiveFedora::NokogiriDatastream do
|
|
188
189
|
end
|
189
190
|
|
190
191
|
describe '.content=' do
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
192
|
+
subject { ActiveFedora::NokogiriDatastream.new(@mock_inner, "descMetadata") }
|
193
|
+
it "should update the content" do
|
194
|
+
subject.stubs(:new? => false )
|
195
|
+
subject.content = "<a />"
|
196
|
+
subject.datastream_content.should == '<a />'
|
197
|
+
end
|
198
|
+
|
199
|
+
it "should mark the object as changed" do
|
200
|
+
subject.stubs(:new? => false )
|
201
|
+
subject.content = "<a />"
|
202
|
+
subject.should be_changed
|
203
|
+
end
|
204
|
+
|
205
|
+
it "update ngxml and mark the xml as loaded" do
|
206
|
+
subject.stubs(:new? => false )
|
207
|
+
subject.content = "<a />"
|
208
|
+
subject.ng_xml.to_xml.should =~ /<a\/>/
|
209
|
+
subject.xml_loaded.should be_true
|
199
210
|
end
|
200
211
|
end
|
201
212
|
|
@@ -214,11 +225,11 @@ describe ActiveFedora::NokogiriDatastream do
|
|
214
225
|
@test_ds2.ng_xml.should be_kind_of Nokogiri::XML::Document
|
215
226
|
@test_ds2.ng_xml.to_xml.should be_equivalent_to("<xmlelement/>")
|
216
227
|
end
|
217
|
-
it "should mark the datastream as
|
218
|
-
@test_ds2.
|
228
|
+
it "should mark the datastream as changed" do
|
229
|
+
@test_ds2.should_not be_changed
|
219
230
|
@test_ds2.ng_xml = @sample_raw_xml
|
220
231
|
@test_ds2.ng_xml_changed?.should be_true
|
221
|
-
@test_ds2.should
|
232
|
+
@test_ds2.should be_changed
|
222
233
|
@test_ds2.instance_variable_get(:@content).should be_nil
|
223
234
|
end
|
224
235
|
end
|
@@ -342,11 +353,11 @@ describe ActiveFedora::NokogiriDatastream do
|
|
342
353
|
@mods_ds.update_values([{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"})
|
343
354
|
end
|
344
355
|
|
345
|
-
it "should set
|
356
|
+
it "should set changed to true" do
|
346
357
|
mods_ds = Hydra::ModsArticleDatastream.new
|
347
358
|
mods_ds.content=fixture(File.join("mods_articles","hydrangea_article1.xml")).read
|
348
359
|
mods_ds.update_values([{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"})
|
349
|
-
mods_ds.
|
360
|
+
mods_ds.should be_changed
|
350
361
|
end
|
351
362
|
end
|
352
363
|
|
@@ -126,15 +126,11 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
@subject = MyDatastream.new(@inner_object, 'mixed_rdf')
|
129
|
-
@subject.stubs(:pid => 'test:1')
|
129
|
+
@subject.stubs(:pid => 'test:1', :repository => ActiveFedora::Base.connection_for_pid(0))
|
130
130
|
end
|
131
131
|
after(:each) do
|
132
132
|
Object.send(:remove_const, :MyDatastream)
|
133
133
|
end
|
134
|
-
it "should save and reload" do
|
135
|
-
@subject.publisher = ["St. Martin's Press"]
|
136
|
-
@subject.save
|
137
|
-
end
|
138
134
|
it "should support to_s method" do
|
139
135
|
@subject.publisher.to_s.should == [].to_s
|
140
136
|
@subject.publisher = "Bob"
|
@@ -261,6 +257,9 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
261
257
|
delegate :rights, :to => :descMetadata
|
262
258
|
end
|
263
259
|
@obj = MyDatastream.new(@inner_object, 'solr_rdf')
|
260
|
+
@obj.stubs(:repository => mock(), :pid => 'test:1')
|
261
|
+
@obj.repository.stubs(:modify_datastream)
|
262
|
+
@obj.repository.stubs(:add_datastream)
|
264
263
|
@obj.created = "2012-03-04"
|
265
264
|
@obj.title = "Of Mice and Men, The Sequel"
|
266
265
|
@obj.publisher = "Bob's Blogtastic Publishing"
|
@@ -271,18 +270,16 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
271
270
|
end
|
272
271
|
describe '#save' do
|
273
272
|
it "should set dirty? to false" do
|
274
|
-
@obj.
|
273
|
+
@obj.should_not be_changed
|
275
274
|
@obj.title = "something"
|
276
|
-
@obj.
|
275
|
+
@obj.should be_changed
|
277
276
|
@obj.save
|
278
|
-
@obj.
|
277
|
+
@obj.should_not be_changed
|
279
278
|
end
|
280
279
|
end
|
281
280
|
describe '.content=' do
|
282
281
|
it "should update the content and graph, marking the datastream as changed" do
|
283
282
|
mock_repo = mock('repository')
|
284
|
-
mock_repo.expects(:datastream_dissemination).with(:pid => 'test:123',
|
285
|
-
:dsid => 'solr_rdf')
|
286
283
|
sample_rdf = File.new('spec/fixtures/mixed_rdf_descMetadata.nt').read
|
287
284
|
@obj.stubs(:pid).returns('test:123')
|
288
285
|
@obj.stubs(:repository).returns(mock_repo)
|
@@ -19,20 +19,9 @@ describe ActiveFedora::Persistence do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "#update_needs_index?" do
|
22
|
-
describe "when metadata is dirty" do
|
23
|
-
before do
|
24
|
-
subject.send(:metadata_is_dirty=, true)
|
25
|
-
end
|
26
22
|
it "should be true" do
|
27
23
|
subject.send(:update_needs_index?).should be_true
|
28
24
|
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "when metadata is not dirty" do
|
32
|
-
it "should be false" do
|
33
|
-
subject.send(:update_needs_index?).should be_false
|
34
|
-
end
|
35
|
-
end
|
36
25
|
end
|
37
26
|
|
38
27
|
|
@@ -60,8 +60,7 @@ describe ActiveFedora::QualifiedDublinCoreDatastream do
|
|
60
60
|
n = ActiveFedora::QualifiedDublinCoreDatastream.from_xml(stream.to_xml, ds)
|
61
61
|
n.spatial.should == ["Boston [7013445]", "Dorchester [7013575]", "Roxbury [7015002]"]
|
62
62
|
n.title.should == ["Oral history with Frances Addelson, 1997 November 14"]
|
63
|
-
n.
|
64
|
-
|
63
|
+
n.should_not be_changed
|
65
64
|
end
|
66
65
|
|
67
66
|
|
@@ -90,7 +90,7 @@ describe ActiveFedora::Relationships do
|
|
90
90
|
#local_node.internal_uri = "info:fedora/#{@pid}"
|
91
91
|
local_node.pid = @pid
|
92
92
|
|
93
|
-
local_node.expects(:rels_ext).returns(stub("rels_ext", :
|
93
|
+
local_node.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).at_least_once
|
94
94
|
local_node.add_relationship(:is_member_of, "info:fedora/container:A")
|
95
95
|
local_node.add_relationship(:is_member_of, "info:fedora/container:B")
|
96
96
|
|
@@ -122,7 +122,7 @@ describe ActiveFedora::Relationships do
|
|
122
122
|
@test_object2 = MockHasRelationship.new
|
123
123
|
@test_object2.pid = increment_pid
|
124
124
|
@test_object2.stubs(:testing_inbound).returns({})
|
125
|
-
@test_object2.expects(:rels_ext).returns(stub("rels_ext", :
|
125
|
+
@test_object2.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content =>'')).at_least_once
|
126
126
|
@test_object2.add_relationship(:has_model, SpecNode.to_class_uri)
|
127
127
|
@test_object2.should respond_to(:testing_append)
|
128
128
|
@test_object2.should respond_to(:testing_remove)
|
@@ -273,7 +273,7 @@ describe ActiveFedora::Relationships do
|
|
273
273
|
it "(:response_format => :id_array) should return an array of fedora PIDs" do
|
274
274
|
SpecNode.create_outbound_relationship_finders("containers", :is_member_of)
|
275
275
|
local_node = SpecNode.new
|
276
|
-
local_node.expects(:rels_ext).returns(stub("rels_ext", :
|
276
|
+
local_node.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).at_least_once
|
277
277
|
local_node.add_relationship(:is_member_of, "demo:10")
|
278
278
|
result = local_node.containers_ids
|
279
279
|
result.should be_instance_of(Array)
|
@@ -363,9 +363,9 @@ describe ActiveFedora::Relationships do
|
|
363
363
|
@local_node2 = SpecNode.new
|
364
364
|
@local_node2.pid = "mypid2"
|
365
365
|
model_def = SpecNode.to_class_uri
|
366
|
-
@local_node.expects(:rels_ext).returns(stub("rels_ext", :
|
366
|
+
@local_node.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).at_least_once
|
367
367
|
@local_node.add_relationship(:has_model, model_def)
|
368
|
-
@local_node2.expects(:rels_ext).returns(stub("rels_ext", :
|
368
|
+
@local_node2.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).at_least_once
|
369
369
|
@local_node2.add_relationship(:has_model, model_def)
|
370
370
|
@local_node.add_relationship(:has_part, @local_node2)
|
371
371
|
@local_node2.add_relationship(:has_part, @local_node)
|
@@ -20,21 +20,26 @@ describe ActiveFedora::RelsExtDatastream do
|
|
20
20
|
mock_inner.stubs(:repository).returns(@mock_repo)
|
21
21
|
mock_inner.stubs(:pid).returns(@pid)
|
22
22
|
@test_ds = ActiveFedora::RelsExtDatastream.new(mock_inner, "RELS-EXT")
|
23
|
+
@test_ds.stubs(:profile).returns({})
|
23
24
|
end
|
24
25
|
|
25
26
|
its(:metadata?) { should be_true}
|
26
27
|
|
27
|
-
describe "#
|
28
|
-
|
29
|
-
@mock_repo.expects(:add_datastream).with(:pid => 'test:sample_pid', :dsid => 'RELS-EXT', :versionable => true, :content => 'fake xml', :controlGroup => 'M', :dsState => 'A', :mimeType=>'application/rdf+xml')
|
30
|
-
@mock_repo.expects(:datastream).with(:pid => 'test:sample_pid', :dsid => 'RELS-EXT').returns("")
|
31
|
-
end
|
32
|
-
it 'should set the mime type' do
|
33
|
-
@test_ds.content = 'fake xml'
|
34
|
-
@test_ds.save
|
28
|
+
describe "#mimeType" do
|
29
|
+
it 'should use the application/rdf+xml mime type' do
|
35
30
|
@test_ds.mimeType.should == 'application/rdf+xml'
|
36
31
|
end
|
37
32
|
end
|
33
|
+
|
34
|
+
describe "#changed?" do
|
35
|
+
it "should be false when no changes have been made" do
|
36
|
+
subject.changed?.should == false
|
37
|
+
end
|
38
|
+
it "should be true when the model has changes" do
|
39
|
+
subject.model = stub(:relationships_are_dirty=>true)
|
40
|
+
subject.changed?.should == true
|
41
|
+
end
|
42
|
+
end
|
38
43
|
|
39
44
|
|
40
45
|
describe '#serialize!' do
|
@@ -44,7 +49,7 @@ describe ActiveFedora::RelsExtDatastream do
|
|
44
49
|
subject = RDF::URI.new "info:fedora/test:sample_pid"
|
45
50
|
graph.insert RDF::Statement.new(subject, ActiveFedora::Predicates.find_graph_predicate(:is_member_of), RDF::URI.new('demo:10'))
|
46
51
|
|
47
|
-
@test_ds.
|
52
|
+
@test_ds.stubs(:new? => true, :relationships_are_dirty? =>true, :relationships => graph, :model => mock(:relationships_are_dirty= => true))
|
48
53
|
@test_ds.serialize!
|
49
54
|
EquivalentXml.equivalent?(@test_ds.content, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\n <rdf:Description rdf:about='info:fedora/test:sample_pid'>\n <isMemberOf rdf:resource='demo:10' xmlns='info:fedora/fedora-system:def/relations-external#'/></rdf:Description>\n </rdf:RDF>").should be_true
|
50
55
|
end
|
@@ -47,11 +47,11 @@ describe ActiveFedora::SemanticNode do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
@node = SpecNode.new
|
50
|
-
@node.stubs(:rels_ext).returns(stub("rels_ext", :
|
50
|
+
@node.stubs(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>''))
|
51
51
|
@node.pid = increment_pid
|
52
52
|
@test_object = SpecNode2.new
|
53
53
|
@test_object.pid = increment_pid
|
54
|
-
@test_object.stubs(:rels_ext).returns(stub("rels_ext", :
|
54
|
+
@test_object.stubs(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>''))
|
55
55
|
end
|
56
56
|
|
57
57
|
after(:each) do
|
@@ -105,7 +105,7 @@ describe ActiveFedora::SemanticNode do
|
|
105
105
|
it "adding relationship to an instance should not affect class-level relationships hash" do
|
106
106
|
local_test_node1 = SpecNode.new
|
107
107
|
local_test_node2 = SpecNode.new
|
108
|
-
local_test_node1.expects(:rels_ext).returns(stub("rels_ext", :
|
108
|
+
local_test_node1.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).at_least_once
|
109
109
|
local_test_node1.add_relationship(:is_member_of, 'demo:10')
|
110
110
|
local_test_node2.expects(:rels_ext).returns(stub('rels-ext', :content=>''))
|
111
111
|
|
@@ -137,7 +137,7 @@ describe ActiveFedora::SemanticNode do
|
|
137
137
|
|
138
138
|
describe '#remove_relationship' do
|
139
139
|
it 'should remove a relationship from the relationships hash' do
|
140
|
-
@test_object.expects(:rels_ext).returns(stub("rels_ext", :
|
140
|
+
@test_object.expects(:rels_ext).returns(stub("rels_ext", :content_will_change! => true, :content=>'')).times(4)
|
141
141
|
@test_object.add_relationship(:has_part, "info:fedora/3")
|
142
142
|
@test_object.add_relationship(:has_part, "info:fedora/4")
|
143
143
|
#check both are there
|
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: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-12-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rsolr
|
@@ -132,7 +132,7 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - ~>
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: 0.
|
135
|
+
version: 0.8.0
|
136
136
|
type: :runtime
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -140,7 +140,7 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - ~>
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 0.
|
143
|
+
version: 0.8.0
|
144
144
|
- !ruby/object:Gem::Dependency
|
145
145
|
name: rdf
|
146
146
|
requirement: !ruby/object:Gem::Requirement
|
@@ -371,6 +371,7 @@ files:
|
|
371
371
|
- lib/active_fedora/predicates.rb
|
372
372
|
- lib/active_fedora/property.rb
|
373
373
|
- lib/active_fedora/qualified_dublin_core_datastream.rb
|
374
|
+
- lib/active_fedora/railtie.rb
|
374
375
|
- lib/active_fedora/rdf_datastream.rb
|
375
376
|
- lib/active_fedora/rdf_xml_writer.rb
|
376
377
|
- lib/active_fedora/rdfxml_rdf_datastream.rb
|
@@ -384,9 +385,25 @@ files:
|
|
384
385
|
- lib/active_fedora/simple_datastream.rb
|
385
386
|
- lib/active_fedora/solr_digital_object.rb
|
386
387
|
- lib/active_fedora/solr_service.rb
|
388
|
+
- lib/active_fedora/test_support.rb
|
387
389
|
- lib/active_fedora/unsaved_digital_object.rb
|
388
390
|
- lib/active_fedora/validations.rb
|
389
391
|
- lib/active_fedora/version.rb
|
392
|
+
- lib/generators/active_fedora/config/USAGE
|
393
|
+
- lib/generators/active_fedora/config/config_generator.rb
|
394
|
+
- lib/generators/active_fedora/config/fedora/fedora_generator.rb
|
395
|
+
- lib/generators/active_fedora/config/fedora/templates/fedora.yml
|
396
|
+
- lib/generators/active_fedora/config/fedora/templates/fedora_conf/conf/development/fedora.fcfg
|
397
|
+
- lib/generators/active_fedora/config/fedora/templates/fedora_conf/conf/test/fedora.fcfg
|
398
|
+
- lib/generators/active_fedora/config/solr/solr_generator.rb
|
399
|
+
- lib/generators/active_fedora/config/solr/templates/solr.yml
|
400
|
+
- lib/generators/active_fedora/config/solr/templates/solr_conf/conf/schema.xml
|
401
|
+
- lib/generators/active_fedora/config/solr/templates/solr_conf/conf/solrconfig.xml
|
402
|
+
- lib/generators/active_fedora/config/solr/templates/solr_conf/solr.xml
|
403
|
+
- lib/generators/active_fedora/model/USAGE
|
404
|
+
- lib/generators/active_fedora/model/model_generator.rb
|
405
|
+
- lib/generators/active_fedora/model/templates/model.rb.erb
|
406
|
+
- lib/generators/active_fedora/model/templates/model_spec.rb.erb
|
390
407
|
- lib/tasks/active_fedora.rake
|
391
408
|
- lib/tasks/active_fedora_dev.rake
|
392
409
|
- script/console
|
@@ -400,6 +417,7 @@ files:
|
|
400
417
|
- spec/fixtures/dino_jpg_no_file_ext
|
401
418
|
- spec/fixtures/dublin_core_rdf_descMetadata.nt
|
402
419
|
- spec/fixtures/hydrangea_fixture_mods_article1.foxml.xml
|
420
|
+
- spec/fixtures/hydrangea_fixture_mods_article2.foxml.xml
|
403
421
|
- spec/fixtures/minivan.jpg
|
404
422
|
- spec/fixtures/mixed_rdf_descMetadata.nt
|
405
423
|
- spec/fixtures/mods_articles/hydrangea_article1.xml
|
@@ -542,10 +560,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
542
560
|
version: '0'
|
543
561
|
segments:
|
544
562
|
- 0
|
545
|
-
hash:
|
563
|
+
hash: -1107417416523628890
|
546
564
|
requirements: []
|
547
565
|
rubyforge_project: rubyfedora
|
548
|
-
rubygems_version: 1.8.
|
566
|
+
rubygems_version: 1.8.23
|
549
567
|
signing_key:
|
550
568
|
specification_version: 3
|
551
569
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
@@ -556,6 +574,7 @@ test_files:
|
|
556
574
|
- spec/fixtures/dino_jpg_no_file_ext
|
557
575
|
- spec/fixtures/dublin_core_rdf_descMetadata.nt
|
558
576
|
- spec/fixtures/hydrangea_fixture_mods_article1.foxml.xml
|
577
|
+
- spec/fixtures/hydrangea_fixture_mods_article2.foxml.xml
|
559
578
|
- spec/fixtures/minivan.jpg
|
560
579
|
- spec/fixtures/mixed_rdf_descMetadata.nt
|
561
580
|
- spec/fixtures/mods_articles/hydrangea_article1.xml
|