ddr-models 2.4.6 → 2.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e01bbd2e47ba6a38f71653a7abcac2db6b73e438
4
- data.tar.gz: 4e5eb3511d2e31f86879fd1b8d2ff9ab12f994ef
3
+ metadata.gz: f6f4046f421e1eff0e98a72a91752fcefdc2d58b
4
+ data.tar.gz: 19170b14ef451f3f41f5dc265462e54e86da74a8
5
5
  SHA512:
6
- metadata.gz: 8cee3c59573413499ff0a3362aa75b811e177a3119612e2805102e96dc7d49b2cbfc96fbcde6bdf95a7df74a98176042790b2bf18c22ae3d3099c470c6071143
7
- data.tar.gz: 7225dd1b450f4491cc3fe079ee3b17bc55382665c945be0667bcd722ba95162a654f1ab733748a0f8ff4ac5ba167a760faeb761df42d0e2ef816440602219fe5
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: "dc",
57
- export: "no"
57
+ { :profile => "dc",
58
+ :export => "no",
59
+ FCREPO3_PID => object.pid
58
60
  }
59
61
  end
60
62
 
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "2.4.6"
3
+ VERSION = "2.4.7"
4
4
  end
5
5
  end
@@ -49,15 +49,29 @@ module Ddr::Models
49
49
  end
50
50
 
51
51
  describe "lifecycle" do
52
- let!(:identifier) { Ezid::MockIdentifier.new(id: "ark:/99999/fk4zzz", status: "public") }
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("ark:/99999/fk4zzz") { identifier }
56
- subject.permanent_id = "ark:/99999/fk4zzz"
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
- it "should update the status of the identifier when the object is destroyed" do
60
- expect { subject.destroy }.to change(identifier, :status).from("public").to("unavailable | deleted")
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.6
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-18 00:00:00.000000000 Z
12
+ date: 2016-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails