active-fedora 9.12.0 → 9.13.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 +4 -4
- data/.rubocop.yml +1 -1
- data/active-fedora.gemspec +1 -0
- data/lib/active_fedora.rb +1 -0
- data/lib/active_fedora/associations.rb +38 -3
- data/lib/active_fedora/associations/basic_contains_association.rb +12 -51
- data/lib/active_fedora/associations/builder/aggregation.rb +1 -1
- data/lib/active_fedora/associations/builder/basic_contains.rb +7 -0
- data/lib/active_fedora/associations/builder/{contains.rb → has_subresource.rb} +2 -2
- data/lib/active_fedora/associations/contains_association.rb +19 -1
- data/lib/active_fedora/associations/directly_contains_association.rb +1 -15
- data/lib/active_fedora/associations/has_subresource_association.rb +61 -0
- data/lib/active_fedora/attached_files.rb +6 -9
- data/lib/active_fedora/autosave_association.rb +1 -1
- data/lib/active_fedora/base.rb +0 -1
- data/lib/active_fedora/common.rb +1 -0
- data/lib/active_fedora/fedora.rb +14 -19
- data/lib/active_fedora/file.rb +1 -1
- data/lib/active_fedora/file/attributes.rb +4 -0
- data/lib/active_fedora/file_persistence.rb +9 -1
- data/lib/active_fedora/initializing_connection.rb +64 -0
- data/lib/active_fedora/ldp_cache.rb +1 -2
- data/lib/active_fedora/ldp_resource_service.rb +7 -1
- data/lib/active_fedora/persistence.rb +12 -1
- data/lib/active_fedora/reflection.rb +22 -6
- data/lib/active_fedora/simple_datastream.rb +2 -0
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/fedora/fedora_generator.rb +1 -0
- data/lib/generators/active_fedora/config/fedora/templates/.fcrepo_wrapper +1 -0
- data/lib/generators/active_fedora/config/fedora/templates/fcrepo_wrapper_test.yml +4 -0
- data/lib/generators/active_fedora/config/solr/solr_generator.rb +1 -0
- data/lib/generators/active_fedora/config/solr/templates/.solr_wrapper +3 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml +8 -0
- data/spec/integration/attached_files_spec.rb +77 -18
- data/spec/integration/attributes_spec.rb +3 -4
- data/spec/integration/autosave_association_spec.rb +0 -1
- data/spec/integration/base_spec.rb +19 -66
- data/spec/integration/basic_contains_association_spec.rb +108 -0
- data/spec/integration/complex_rdf_datastream_spec.rb +1 -1
- data/spec/integration/field_to_solr_name_spec.rb +12 -11
- data/spec/integration/file_fixity_spec.rb +1 -1
- data/spec/integration/file_spec.rb +4 -1
- data/spec/integration/generators/fedora_generator_spec.rb +26 -0
- data/spec/integration/generators/solr_generator_spec.rb +26 -0
- data/spec/integration/has_and_belongs_to_many_associations_spec.rb +6 -16
- data/spec/integration/has_many_associations_spec.rb +6 -16
- data/spec/integration/{contains_association_spec.rb → has_subresource_spec.rb} +1 -1
- data/spec/integration/json_serialization_spec.rb +11 -5
- data/spec/integration/model_spec.rb +7 -13
- data/spec/integration/ntriples_datastream_spec.rb +2 -2
- data/spec/integration/om_datastream_spec.rb +1 -1
- data/spec/integration/persistence_spec.rb +0 -3
- data/spec/integration/query_result_builder_spec.rb +1 -1
- data/spec/integration/relation_delegation_spec.rb +3 -8
- data/spec/integration/scoped_query_spec.rb +5 -7
- data/spec/integration/solr_hit_spec.rb +10 -4
- data/spec/integration/solr_instance_loader_spec.rb +11 -4
- data/spec/integration/versionable_spec.rb +3 -3
- data/spec/spec_helper.rb +5 -1
- data/spec/unit/active_fedora_spec.rb +1 -1
- data/spec/unit/attached_files_spec.rb +32 -21
- data/spec/unit/attributes_spec.rb +21 -23
- data/spec/unit/base_active_model_spec.rb +13 -10
- data/spec/unit/base_spec.rb +2 -24
- data/spec/unit/callback_spec.rb +0 -8
- data/spec/unit/core_spec.rb +3 -5
- data/spec/unit/inheritance_spec.rb +15 -9
- data/spec/unit/ntriples_datastream_spec.rb +1 -1
- data/spec/unit/om_datastream_spec.rb +1 -1
- data/spec/unit/persistence_spec.rb +21 -0
- data/spec/unit/query_spec.rb +8 -0
- data/spec/unit/rdf_datastream_spec.rb +1 -1
- data/spec/unit/rdf_resource_datastream_spec.rb +1 -1
- data/spec/unit/simple_datastream_spec.rb +8 -2
- data/spec/unit/solr_config_options_spec.rb +1 -1
- data/spec/unit/validations_spec.rb +2 -8
- metadata +27 -6
- data/spec/integration/bug_spec.rb +0 -40
- data/spec/integration/full_featured_model_spec.rb +0 -160
@@ -15,19 +15,22 @@ describe ActiveFedora::Base do
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
class
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
has_metadata type: ActiveFedora::SimpleDatastream, name: "withText" do |m|
|
24
|
-
m.field "fubar", :text
|
18
|
+
class BazStream < ActiveFedora::OmDatastream
|
19
|
+
set_terminology do |t|
|
20
|
+
t.root(path: "first", xmlns: "urn:foobar")
|
21
|
+
t.fubar
|
25
22
|
end
|
26
|
-
|
27
|
-
|
23
|
+
|
24
|
+
def self.xml_template
|
25
|
+
Nokogiri::XML::Document.parse '<first xmlns="urn:foobar">
|
26
|
+
<fubar></fubar>
|
27
|
+
</first>'
|
28
28
|
end
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
+
class BarHistory < ActiveFedora::Base
|
32
|
+
has_subresource 'xmlish', class_name: 'BarStream'
|
33
|
+
has_subresource 'withText', class_name: 'BazStream'
|
31
34
|
Deprecation.silence(ActiveFedora::Attributes) do
|
32
35
|
has_attributes :fubar, datastream: 'withText', multiple: false
|
33
36
|
has_attributes :duck, datastream: 'xmlish', multiple: false
|
data/spec/unit/base_spec.rb
CHANGED
@@ -111,34 +111,12 @@ describe ActiveFedora::Base do
|
|
111
111
|
describe "With a test class" do
|
112
112
|
before do
|
113
113
|
class FooHistory < ActiveFedora::Base
|
114
|
-
|
115
|
-
m.field "fubar", :string
|
116
|
-
m.field "swank", :text
|
117
|
-
end
|
118
|
-
has_metadata "withText", type: ActiveFedora::SimpleDatastream, autocreate: true do |m|
|
119
|
-
m.field "fubar", :text
|
120
|
-
end
|
121
|
-
has_metadata "withText2", type: ActiveFedora::SimpleDatastream, autocreate: true do |m|
|
122
|
-
m.field "fubar", :text
|
123
|
-
end
|
124
|
-
Deprecation.silence(ActiveFedora::Attributes) do
|
125
|
-
has_attributes :fubar, datastream: 'withText', multiple: true
|
126
|
-
has_attributes :swank, datastream: 'someData', multiple: true
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
class FooAdaptation < ActiveFedora::Base
|
131
|
-
has_metadata 'someData', type: ActiveFedora::OmDatastream
|
132
|
-
end
|
133
|
-
|
134
|
-
class FooInherited < FooHistory
|
114
|
+
property :fubar, predicate: ::RDF::URI('http://example.com/fubar')
|
135
115
|
end
|
136
116
|
end
|
137
117
|
|
138
118
|
after do
|
139
119
|
Object.send(:remove_const, :FooHistory)
|
140
|
-
Object.send(:remove_const, :FooAdaptation)
|
141
|
-
Object.send(:remove_const, :FooInherited)
|
142
120
|
end
|
143
121
|
|
144
122
|
def increment_id
|
@@ -305,7 +283,7 @@ describe ActiveFedora::Base do
|
|
305
283
|
obj = double
|
306
284
|
expect(obj).to receive(:save)
|
307
285
|
expect(FooHistory).to receive(:new).and_return(obj)
|
308
|
-
|
286
|
+
FooHistory.create(fubar: 'ta')
|
309
287
|
end
|
310
288
|
end
|
311
289
|
|
data/spec/unit/callback_spec.rb
CHANGED
@@ -3,14 +3,6 @@ require 'spec_helper'
|
|
3
3
|
describe ActiveFedora::Base do
|
4
4
|
before :each do
|
5
5
|
class CallbackStub < ActiveFedora::Base
|
6
|
-
has_metadata type: ActiveFedora::SimpleDatastream, name: "someData" do |m|
|
7
|
-
m.field "fubar", :string
|
8
|
-
m.field "swank", :text
|
9
|
-
end
|
10
|
-
Deprecation.silence(ActiveFedora::Attributes) do
|
11
|
-
has_attributes :fubar, :swank, datastream: 'someData', multiple: true
|
12
|
-
end
|
13
|
-
|
14
6
|
after_initialize :a_init
|
15
7
|
before_save :b_save
|
16
8
|
after_save :a_save
|
data/spec/unit/core_spec.rb
CHANGED
@@ -9,10 +9,8 @@ describe ActiveFedora::Base do
|
|
9
9
|
end
|
10
10
|
class Book < ActiveFedora::Base
|
11
11
|
belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
has_metadata "bar", type: MyDatastream
|
12
|
+
has_subresource "foo", class_name: 'ActiveFedora::QualifiedDublinCoreDatastream'
|
13
|
+
has_subresource "bar", class_name: 'MyDatastream'
|
16
14
|
Deprecation.silence(ActiveFedora::Attributes) do
|
17
15
|
has_attributes :title, datastream: 'foo' # Om backed property
|
18
16
|
has_attributes :publisher, datastream: 'bar' # RDF backed property
|
@@ -65,7 +63,7 @@ describe ActiveFedora::Base do
|
|
65
63
|
it "makes the om properties immutable" do
|
66
64
|
expect {
|
67
65
|
subject.title = "HEY"
|
68
|
-
}.to raise_error RuntimeError, "can't modify frozen ActiveFedora::
|
66
|
+
}.to raise_error RuntimeError, "can't modify frozen ActiveFedora::QualifiedDublinCoreDatastream"
|
69
67
|
expect(subject.title).to eq "War and Peace"
|
70
68
|
end
|
71
69
|
|
@@ -2,16 +2,16 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe ActiveFedora::Base do
|
4
4
|
before do
|
5
|
+
class MyDS < ActiveFedora::OmDatastream
|
6
|
+
end
|
5
7
|
class Foo < ActiveFedora::Base
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
has_metadata 'dcstream', type: ActiveFedora::QualifiedDublinCoreDatastream
|
8
|
+
extend Deprecation
|
9
|
+
has_subresource 'foostream', class_name: 'MyDS'
|
10
|
+
has_subresource 'dcstream', class_name: 'ActiveFedora::QualifiedDublinCoreDatastream'
|
10
11
|
end
|
11
12
|
class Bar < ActiveFedora::Base
|
12
|
-
|
13
|
-
|
14
|
-
end
|
13
|
+
extend Deprecation
|
14
|
+
has_subresource 'barstream', class_name: 'MyDS'
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -19,17 +19,23 @@ describe ActiveFedora::Base do
|
|
19
19
|
f = Foo.new
|
20
20
|
expect(f.attached_files.size).to eq 2
|
21
21
|
streams = f.attached_files.values.map { |x| x.class.to_s }.sort
|
22
|
-
expect(streams.pop).to eq "
|
22
|
+
expect(streams.pop).to eq "MyDS"
|
23
23
|
expect(streams.pop).to eq "ActiveFedora::QualifiedDublinCoreDatastream"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "works for multiple types" do
|
27
27
|
b = Foo.new
|
28
28
|
f = Bar.new
|
29
|
-
|
29
|
+
Deprecation.silence(Foo) do
|
30
|
+
Deprecation.silence(Bar) do
|
31
|
+
expect(b.class.ds_specs).to_not eq f.class.ds_specs
|
32
|
+
end
|
33
|
+
end
|
30
34
|
end
|
35
|
+
|
31
36
|
after do
|
32
37
|
Object.send(:remove_const, :Bar)
|
33
38
|
Object.send(:remove_const, :Foo)
|
39
|
+
Object.send(:remove_const, :MyDS)
|
34
40
|
end
|
35
41
|
end
|
@@ -196,7 +196,7 @@ EOF
|
|
196
196
|
describe "with an actual object" do
|
197
197
|
before(:each) do
|
198
198
|
class Foo < ActiveFedora::Base
|
199
|
-
|
199
|
+
has_subresource "descMetadata", class_name: 'MyDatastream'
|
200
200
|
Deprecation.silence(ActiveFedora::Attributes) do
|
201
201
|
has_attributes :created, :title, :publisher, :based_near, :related_url, :rights, datastream: :descMetadata, multiple: true
|
202
202
|
end
|
@@ -306,7 +306,7 @@ describe ActiveFedora::OmDatastream do
|
|
306
306
|
describe "an instance that exists in the datastore, but hasn't been loaded" do
|
307
307
|
before do
|
308
308
|
class MyObj < ActiveFedora::Base
|
309
|
-
|
309
|
+
has_subresource 'descMetadata', class_name: 'Hydra::ModsArticleDatastream'
|
310
310
|
end
|
311
311
|
@obj = MyObj.new
|
312
312
|
@obj.descMetadata.title = 'Foobar'
|
@@ -1,6 +1,19 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe ActiveFedora::Persistence do
|
4
|
+
describe '#new_record?' do
|
5
|
+
context 'with an new object' do
|
6
|
+
subject { ActiveFedora::Base.new }
|
7
|
+
it { is_expected.to be_new_record }
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'with an destroyed object' do
|
11
|
+
subject { ActiveFedora::Base.create }
|
12
|
+
before { subject.delete }
|
13
|
+
it { is_expected.not_to be_new_record }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
4
17
|
describe '.delete' do
|
5
18
|
context 'with an unsaved object' do
|
6
19
|
subject { ActiveFedora::Base.new }
|
@@ -22,6 +35,14 @@ describe ActiveFedora::Persistence do
|
|
22
35
|
expect { |b| ActiveFedora::Base.create(&b) }.to yield_with_args(an_instance_of(ActiveFedora::Base))
|
23
36
|
end
|
24
37
|
end
|
38
|
+
|
39
|
+
context "when trying to create it again" do
|
40
|
+
let(:object) { ActiveFedora::Base.create! }
|
41
|
+
|
42
|
+
it "raises an error" do
|
43
|
+
expect { ActiveFedora::Base.create(id: object.id) }.to raise_error(ActiveFedora::IllegalOperation, "Attempting to recreate existing ldp_source: `#{object.uri}'")
|
44
|
+
end
|
45
|
+
end
|
25
46
|
end
|
26
47
|
|
27
48
|
describe '.destroy' do
|
data/spec/unit/query_spec.rb
CHANGED
@@ -67,6 +67,14 @@ describe ActiveFedora::Base do
|
|
67
67
|
SpecModel::Basic.find(id: "_ID_")
|
68
68
|
end
|
69
69
|
end
|
70
|
+
|
71
|
+
context "with a blank string" do
|
72
|
+
it 'raises ActiveFedora::ObjectNotFoundError' do
|
73
|
+
expect {
|
74
|
+
SpecModel::Basic.find('')
|
75
|
+
}.to raise_error(ActiveFedora::ObjectNotFoundError)
|
76
|
+
end
|
77
|
+
end
|
70
78
|
end
|
71
79
|
|
72
80
|
describe "#where" do
|
@@ -15,7 +15,7 @@ describe ActiveFedora::RDFDatastream do
|
|
15
15
|
property :description, predicate: ::RDF::Vocab::DC.description
|
16
16
|
end
|
17
17
|
class MyObj < ActiveFedora::Base
|
18
|
-
|
18
|
+
has_subresource 'descMetadata', class_name: 'MyDatastream'
|
19
19
|
end
|
20
20
|
@obj = MyObj.new
|
21
21
|
@obj.descMetadata.title = 'Foobar'
|
@@ -25,7 +25,7 @@ describe ActiveFedora::RDFDatastream do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
class DummyAsset < ActiveFedora::Base
|
28
|
-
|
28
|
+
has_subresource 'descMetadata', class_name: 'DummyResource'
|
29
29
|
Deprecation.silence(ActiveFedora::Attributes) do
|
30
30
|
has_attributes :title, :license, datastream: 'descMetadata', multiple: true
|
31
31
|
has_attributes :relation, datastream: 'descMetadata', at: [:license, :relation], multiple: false
|
@@ -4,6 +4,8 @@ describe ActiveFedora::SimpleDatastream do
|
|
4
4
|
let(:sample_xml) { "<fields><coverage>coverage1</coverage><coverage>coverage2</coverage><creation_date>2012-01-15</creation_date><mydate>fake-date</mydate><publisher>publisher1</publisher></fields>" }
|
5
5
|
|
6
6
|
before do
|
7
|
+
@original_behavior = Deprecation.default_deprecation_behavior
|
8
|
+
Deprecation.default_deprecation_behavior = :silence
|
7
9
|
@test_ds = described_class.new
|
8
10
|
allow(@test_ds).to receive(:retrieve_content).and_return('') # DS grabs the old content to compare against the new
|
9
11
|
@test_ds.content = sample_xml
|
@@ -70,8 +72,11 @@ describe ActiveFedora::SimpleDatastream do
|
|
70
72
|
|
71
73
|
before do
|
72
74
|
class FooHistory < ActiveFedora::Base
|
73
|
-
|
74
|
-
|
75
|
+
extend Deprecation
|
76
|
+
Deprecation.silence(FooHistory) do
|
77
|
+
has_metadata type: ActiveFedora::SimpleDatastream, name: "someData" do |m|
|
78
|
+
m.field "fubar", :string
|
79
|
+
end
|
75
80
|
end
|
76
81
|
Deprecation.silence(ActiveFedora::Attributes) do
|
77
82
|
has_attributes :fubar, datastream: 'someData', multiple: false
|
@@ -87,6 +92,7 @@ describe ActiveFedora::SimpleDatastream do
|
|
87
92
|
|
88
93
|
after do
|
89
94
|
Object.send(:remove_const, :FooHistory)
|
95
|
+
Deprecation.default_deprecation_behavior = @original_behavior
|
90
96
|
end
|
91
97
|
|
92
98
|
subject { FooHistory.find(foo.id) }
|
@@ -43,7 +43,7 @@ describe ActiveFedora do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "prevents Base.save from calling update_index if false" do
|
46
|
-
dirty_ds = ActiveFedora::
|
46
|
+
dirty_ds = ActiveFedora::QualifiedDublinCoreDatastream.new
|
47
47
|
@test_object.attached_files['ds1'] = dirty_ds
|
48
48
|
allow(@test_object).to receive(:datastreams).and_return(ds1: dirty_ds)
|
49
49
|
expect(@test_object).to receive(:update_index).never
|
@@ -3,14 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe ActiveFedora::Base do
|
4
4
|
before :all do
|
5
5
|
class ValidationStub < ActiveFedora::Base
|
6
|
-
|
7
|
-
|
8
|
-
m.field "swank", :text
|
9
|
-
end
|
10
|
-
Deprecation.silence(ActiveFedora::Attributes) do
|
11
|
-
has_attributes :fubar, datastream: 'someData', multiple: true
|
12
|
-
has_attributes :swank, datastream: 'someData', multiple: false
|
13
|
-
end
|
6
|
+
property :fubar, predicate: ::RDF::URI('http://example.com/fubar')
|
7
|
+
property :swank, predicate: ::RDF::URI('http://example.com/swank'), multiple: false
|
14
8
|
|
15
9
|
validates_presence_of :fubar
|
16
10
|
validates_length_of :swank, minimum: 5
|
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.
|
4
|
+
version: 9.13.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-
|
13
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -184,6 +184,20 @@ dependencies:
|
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
186
|
version: 0.5.0
|
187
|
+
- !ruby/object:Gem::Dependency
|
188
|
+
name: rails
|
189
|
+
requirement: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
type: :development
|
195
|
+
prerelease: false
|
196
|
+
version_requirements: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
187
201
|
- !ruby/object:Gem::Dependency
|
188
202
|
name: rdoc
|
189
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -382,14 +396,15 @@ files:
|
|
382
396
|
- lib/active_fedora/associations/belongs_to_association.rb
|
383
397
|
- lib/active_fedora/associations/builder/aggregation.rb
|
384
398
|
- lib/active_fedora/associations/builder/association.rb
|
399
|
+
- lib/active_fedora/associations/builder/basic_contains.rb
|
385
400
|
- lib/active_fedora/associations/builder/belongs_to.rb
|
386
401
|
- lib/active_fedora/associations/builder/collection_association.rb
|
387
|
-
- lib/active_fedora/associations/builder/contains.rb
|
388
402
|
- lib/active_fedora/associations/builder/directly_contains.rb
|
389
403
|
- lib/active_fedora/associations/builder/directly_contains_one.rb
|
390
404
|
- lib/active_fedora/associations/builder/filter.rb
|
391
405
|
- lib/active_fedora/associations/builder/has_and_belongs_to_many.rb
|
392
406
|
- lib/active_fedora/associations/builder/has_many.rb
|
407
|
+
- lib/active_fedora/associations/builder/has_subresource.rb
|
393
408
|
- lib/active_fedora/associations/builder/indirectly_contains.rb
|
394
409
|
- lib/active_fedora/associations/builder/orders.rb
|
395
410
|
- lib/active_fedora/associations/builder/property.rb
|
@@ -406,6 +421,7 @@ files:
|
|
406
421
|
- lib/active_fedora/associations/filter_association.rb
|
407
422
|
- lib/active_fedora/associations/has_and_belongs_to_many_association.rb
|
408
423
|
- lib/active_fedora/associations/has_many_association.rb
|
424
|
+
- lib/active_fedora/associations/has_subresource_association.rb
|
409
425
|
- lib/active_fedora/associations/id_composite.rb
|
410
426
|
- lib/active_fedora/associations/indirectly_contains_association.rb
|
411
427
|
- lib/active_fedora/associations/null_validator.rb
|
@@ -472,6 +488,7 @@ files:
|
|
472
488
|
- lib/active_fedora/indexing_service.rb
|
473
489
|
- lib/active_fedora/inheritable_accessors.rb
|
474
490
|
- lib/active_fedora/inheritance.rb
|
491
|
+
- lib/active_fedora/initializing_connection.rb
|
475
492
|
- lib/active_fedora/ldp_cache.rb
|
476
493
|
- lib/active_fedora/ldp_resource.rb
|
477
494
|
- lib/active_fedora/ldp_resource_service.rb
|
@@ -549,6 +566,7 @@ files:
|
|
549
566
|
- lib/generators/active_fedora/config/config_generator.rb
|
550
567
|
- lib/generators/active_fedora/config/fedora/fedora_generator.rb
|
551
568
|
- lib/generators/active_fedora/config/fedora/templates/.fcrepo_wrapper
|
569
|
+
- lib/generators/active_fedora/config/fedora/templates/fcrepo_wrapper_test.yml
|
552
570
|
- lib/generators/active_fedora/config/fedora/templates/fedora.yml
|
553
571
|
- lib/generators/active_fedora/config/solr/solr_generator.rb
|
554
572
|
- lib/generators/active_fedora/config/solr/templates/.solr_wrapper
|
@@ -569,6 +587,7 @@ files:
|
|
569
587
|
- lib/generators/active_fedora/config/solr/templates/solr/config/xslt/example_atom.xsl
|
570
588
|
- lib/generators/active_fedora/config/solr/templates/solr/config/xslt/example_rss.xsl
|
571
589
|
- lib/generators/active_fedora/config/solr/templates/solr/config/xslt/luke.xsl
|
590
|
+
- lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml
|
572
591
|
- lib/generators/active_fedora/model/USAGE
|
573
592
|
- lib/generators/active_fedora/model/model_generator.rb
|
574
593
|
- lib/generators/active_fedora/model/templates/datastream.rb.erb
|
@@ -617,13 +636,12 @@ files:
|
|
617
636
|
- spec/integration/attributes_spec.rb
|
618
637
|
- spec/integration/autosave_association_spec.rb
|
619
638
|
- spec/integration/base_spec.rb
|
639
|
+
- spec/integration/basic_contains_association_spec.rb
|
620
640
|
- spec/integration/belongs_to_association_spec.rb
|
621
|
-
- spec/integration/bug_spec.rb
|
622
641
|
- spec/integration/caching_spec.rb
|
623
642
|
- spec/integration/clean_connection_spec.rb
|
624
643
|
- spec/integration/collection_association_spec.rb
|
625
644
|
- spec/integration/complex_rdf_datastream_spec.rb
|
626
|
-
- spec/integration/contains_association_spec.rb
|
627
645
|
- spec/integration/datastream_rdf_nested_attributes_spec.rb
|
628
646
|
- spec/integration/date_time_properties_spec.rb
|
629
647
|
- spec/integration/delete_all_spec.rb
|
@@ -634,10 +652,12 @@ files:
|
|
634
652
|
- spec/integration/field_to_solr_name_spec.rb
|
635
653
|
- spec/integration/file_fixity_spec.rb
|
636
654
|
- spec/integration/file_spec.rb
|
637
|
-
- spec/integration/
|
655
|
+
- spec/integration/generators/fedora_generator_spec.rb
|
656
|
+
- spec/integration/generators/solr_generator_spec.rb
|
638
657
|
- spec/integration/gone_spec.rb
|
639
658
|
- spec/integration/has_and_belongs_to_many_associations_spec.rb
|
640
659
|
- spec/integration/has_many_associations_spec.rb
|
660
|
+
- spec/integration/has_subresource_spec.rb
|
641
661
|
- spec/integration/indexing_spec.rb
|
642
662
|
- spec/integration/indirect_container_spec.rb
|
643
663
|
- spec/integration/json_serialization_spec.rb
|
@@ -770,3 +790,4 @@ signing_key:
|
|
770
790
|
specification_version: 4
|
771
791
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
772
792
|
test_files: []
|
793
|
+
has_rdoc:
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'active_fedora'
|
4
|
-
require 'active_fedora/model'
|
5
|
-
require "rexml/document"
|
6
|
-
|
7
|
-
describe 'bugs' do
|
8
|
-
before do
|
9
|
-
class FooHistory < ActiveFedora::Base
|
10
|
-
has_metadata type: ActiveFedora::SimpleDatastream, name: "someData" do |m|
|
11
|
-
m.field "fubar", :string
|
12
|
-
end
|
13
|
-
end
|
14
|
-
@test_object = FooHistory.new
|
15
|
-
@test_object.save
|
16
|
-
end
|
17
|
-
after do
|
18
|
-
@test_object.delete
|
19
|
-
Object.send(:remove_const, :FooHistory)
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'raises ActiveFedora::ObjectNotFoundError when find("")' do
|
23
|
-
expect {
|
24
|
-
FooHistory.find('')
|
25
|
-
}.to raise_error(ActiveFedora::ObjectNotFoundError)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "does not clobber everything when setting a value" do
|
29
|
-
@test_object.someData.fubar = ['initial']
|
30
|
-
@test_object.save!
|
31
|
-
|
32
|
-
x = FooHistory.find(@test_object.id)
|
33
|
-
x.someData.fubar = ["replacement"] # set a new value
|
34
|
-
x.save!
|
35
|
-
|
36
|
-
x = FooHistory.find(@test_object.id)
|
37
|
-
expect(x.someData.fubar).to eq ["replacement"] # recall the value
|
38
|
-
x.save
|
39
|
-
end
|
40
|
-
end
|