ddr-models 2.4.6 → 2.4.7
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/lib/ddr/managers/permanent_id_manager.rb +4 -2
- data/lib/ddr/models/version.rb +1 -1
- data/spec/models/has_admin_metadata_spec.rb +19 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6f4046f421e1eff0e98a72a91752fcefdc2d58b
|
4
|
+
data.tar.gz: 19170b14ef451f3f41f5dc265462e54e86da74a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 087dc599aead9cb898234e9b20e16e44fe8cd61f74914cf77573ad92a32f6043d0543401c1631e350d12bacdd68970edc474a9f9589deb1e90ec95a10848bcba
|
7
|
+
data.tar.gz: cc83cf6ed16414010004621c928da3768dc06c3669cabb37f8d28198549650101b31034965830c8ba9f8b1514813cc659894177b7acdc058ddda17b488acb03a
|
@@ -13,6 +13,7 @@ module Ddr
|
|
13
13
|
PERMANENT_URL_BASE = "http://id.library.duke.edu/"
|
14
14
|
ASSIGN_EVENT_SUMMARY = "Permanent ID assignment"
|
15
15
|
SOFTWARE = Ezid::Client.version
|
16
|
+
FCREPO3_PID = "fcrepo3.pid"
|
16
17
|
|
17
18
|
attr_reader :object
|
18
19
|
|
@@ -53,8 +54,9 @@ EZID Metadata:
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def default_metadata
|
56
|
-
{ profile
|
57
|
-
export
|
57
|
+
{ :profile => "dc",
|
58
|
+
:export => "no",
|
59
|
+
FCREPO3_PID => object.pid
|
58
60
|
}
|
59
61
|
end
|
60
62
|
|
data/lib/ddr/models/version.rb
CHANGED
@@ -49,15 +49,29 @@ module Ddr::Models
|
|
49
49
|
end
|
50
50
|
|
51
51
|
describe "lifecycle" do
|
52
|
-
|
52
|
+
subject { FactoryGirl.create(:item) }
|
53
|
+
let!(:identifier) {
|
54
|
+
Ezid::MockIdentifier.create(subject.permanent_id_manager.default_metadata)
|
55
|
+
}
|
53
56
|
before do
|
54
57
|
allow(Ddr::Models).to receive(:auto_assign_permanent_ids) { false }
|
55
|
-
allow(Ezid::Identifier).to receive(:find).with(
|
56
|
-
subject.permanent_id =
|
58
|
+
allow(Ezid::Identifier).to receive(:find).with(identifier.id) { identifier }
|
59
|
+
subject.permanent_id = identifier.id
|
57
60
|
subject.save!
|
58
61
|
end
|
59
|
-
|
60
|
-
|
62
|
+
describe "identifier creation" do
|
63
|
+
it "sets default metadata" do
|
64
|
+
expect(identifier.profile).to eq("dc")
|
65
|
+
expect(identifier.export).to eq("no")
|
66
|
+
expect(identifier["fcrepo3.pid"]).to eq(subject.pid)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
describe "object destruction" do
|
70
|
+
it "marks the identifier as unavailable" do
|
71
|
+
expect { subject.destroy }
|
72
|
+
.to change(identifier, :status)
|
73
|
+
.to("unavailable | deleted")
|
74
|
+
end
|
61
75
|
end
|
62
76
|
end
|
63
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddr-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Coble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|