ddr-models 3.0.0.beta.14 → 3.0.0.beta.15

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: fa7faeec493c42d29c2ac9af03f8db073c700678
4
- data.tar.gz: 9688fa99bde0eaffc03946d490e0f0413fa58ce0
3
+ metadata.gz: 14943b8a93dfd78febae156714765420b016dee7
4
+ data.tar.gz: 13cf8eebacb6de43bdacd42e8a9a71d5a1f56778
5
5
  SHA512:
6
- metadata.gz: 383c3cfc797bdf3a6665fb5cf1c275eb4447e85b51cda3c9ff89f2405dfc079cc4a06f679500a1ec68abade1d0908393adc599e46a62e40976c7d580cd46aa0e
7
- data.tar.gz: 1763c37c4f8e28444ebe303de40e0a85c87411943c28694205e3957e8b0a12c10822f3224669ba52139b4ca39909c3b4ca085eacf030724c6e5b11594b5b5ae9
6
+ metadata.gz: 436617c3ea26cf27beccac23a40621dfc8989502de7304de1c12eb8b202cc998f1c600bfd33929731462d84897cd11b653b4cd833d638c7a1ee15e9b08341c6d
7
+ data.tar.gz: 3c531b502c04226ab9dfa17e6ac5aa94990287546a972a911cdd3569938fb353d1c683c69eb7f6045be7b513dc6ad93f452c28395384cf59e117812a00347b90
@@ -6,6 +6,7 @@ module Ddr
6
6
  if member_of? Ddr::Auth.collection_creators_group
7
7
  can :create, ::Collection
8
8
  end
9
+ alias_action :ingest_metadata, to: :update
9
10
  end
10
11
 
11
12
  end
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "3.0.0.beta.14"
3
+ VERSION = "3.0.0.beta.15"
4
4
  end
5
5
  end
@@ -57,21 +57,37 @@ module Ddr::Auth
57
57
  end
58
58
 
59
59
  describe "Collection abilities" do
60
- before do
61
- allow(Ddr::Auth).to receive(:collection_creators_group) { "collection_creators" }
62
- end
63
- describe "when the user is a collection creator" do
60
+ describe "collection creation" do
64
61
  before do
65
- allow(auth_context).to receive(:member_of?).with("collection_creators") { true }
62
+ allow(Ddr::Auth).to receive(:collection_creators_group) { "collection_creators" }
63
+ end
64
+ describe "when the user is a collection creator" do
65
+ before do
66
+ allow(auth_context).to receive(:member_of?).with("collection_creators") { true }
67
+ end
68
+ it { should be_able_to(:create, Collection) }
69
+ end
70
+
71
+ describe "when the user is not a collection creator" do
72
+ before do
73
+ allow(auth_context).to receive(:member_of?).with("collection_creators") { false }
74
+ end
75
+ it { should_not be_able_to(:create, Collection) }
66
76
  end
67
- it { should be_able_to(:create, Collection) }
68
77
  end
69
78
 
70
- describe "when the user is not a collection creator" do
71
- before do
72
- allow(auth_context).to receive(:member_of?).with("collection_creators") { false }
79
+ describe "metadata ingest" do
80
+ let(:coll) { Collection.new }
81
+ describe "ingest_metadata" do
82
+ describe "when the collection can be edited" do
83
+ before { subject.can :update, coll }
84
+ it { should be_able_to(:ingest_metadata, coll) }
85
+ end
86
+ describe "when the collection cannot be edited" do
87
+ before { subject.cannot :update, coll }
88
+ it { should_not be_able_to(:ingest_metadata, coll) }
89
+ end
73
90
  end
74
- it { should_not be_able_to(:create, Collection) }
75
91
  end
76
92
  end
77
93
 
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: 3.0.0.beta.14
4
+ version: 3.0.0.beta.15
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-29 00:00:00.000000000 Z
12
+ date: 2016-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails