hyrax 2.0.0.beta4 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_fixme.yml +0 -1
- data/.travis.yml +4 -3
- data/README.md +3 -3
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +22 -0
- data/app/actors/hyrax/actors/file_set_actor.rb +4 -0
- data/app/actors/hyrax/actors/transfer_request_actor.rb +23 -0
- data/app/assets/javascripts/hyrax/autocomplete/default.es6 +2 -1
- data/app/assets/stylesheets/hyrax/_file_manager.scss +3 -0
- data/app/controllers/hyrax/dashboard/collections_controller.rb +0 -1
- data/app/controllers/hyrax/my_controller.rb +1 -1
- data/app/forms/hyrax/forms/work_form.rb +5 -4
- data/app/helpers/hyrax/content_block_helper_behavior.rb +2 -2
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +0 -7
- data/app/indexers/hyrax/indexes_workflow.rb +1 -1
- data/app/models/admin_set.rb +1 -1
- data/app/models/concerns/hyrax/basic_metadata.rb +1 -1
- data/app/models/concerns/hyrax/in_admin_set.rb +1 -1
- data/app/models/concerns/hyrax/proxy_deposit.rb +0 -8
- data/app/models/concerns/hyrax/solr_document_behavior.rb +0 -11
- data/app/models/concerns/hyrax/user.rb +3 -3
- data/app/models/hyrax/orcid_validator.rb +6 -1
- data/app/services/hyrax/admin_set_create_service.rb +0 -1
- data/app/services/hyrax/default_middleware_stack.rb +1 -0
- data/app/services/hyrax/statistics/depositors/summary.rb +5 -1
- data/app/services/hyrax/statistics/over_time.rb +5 -1
- data/app/services/hyrax/statistics/query_service.rb +55 -0
- data/app/services/hyrax/statistics/works/count.rb +1 -1
- data/app/services/hyrax/workflow/status_list_service.rb +1 -1
- data/app/views/hyrax/base/_form.html.erb +2 -1
- data/app/views/hyrax/base/_form_files.html.erb +0 -2
- data/app/views/hyrax/base/_form_progress.html.erb +1 -1
- data/app/views/hyrax/base/_form_visibility_error.html.erb +3 -0
- data/app/views/hyrax/base/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +4 -1
- data/app/views/hyrax/dashboard/show_user.html.erb +3 -1
- data/app/views/hyrax/file_sets/_show_actions.html.erb +1 -1
- data/app/views/hyrax/homepage/_recent_document.html.erb +1 -1
- data/config/locales/hyrax.de.yml +9 -8
- data/hyrax.gemspec +2 -2
- data/lib/generators/hyrax/config_generator.rb +14 -16
- data/lib/generators/hyrax/templates/config/{hyrax.rb → initializers/hyrax.rb} +21 -0
- data/lib/generators/hyrax/templates/config/{mini_magick.rb → initializers/mini_magick.rb} +0 -0
- data/lib/generators/hyrax/templates/config/{redis_config.rb → initializers/redis_config.rb} +0 -0
- data/lib/hyrax.rb +2 -1
- data/lib/hyrax/configuration.rb +17 -10
- data/lib/hyrax/controlled_vocabularies.rb +9 -0
- data/{app/controlled_vocabularies → lib}/hyrax/controlled_vocabularies/location.rb +0 -0
- data/lib/hyrax/version.rb +1 -1
- data/spec/actors/hyrax/actors/create_with_remote_files_actor_spec.rb +36 -0
- data/spec/actors/hyrax/actors/file_set_actor_spec.rb +5 -1
- data/spec/actors/hyrax/actors/transfer_request_actor_spec.rb +43 -0
- data/spec/controllers/hyrax/admin/admin_sets_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/api/items_controller_spec.rb +4 -4
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +3 -6
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +87 -68
- data/spec/controllers/hyrax/dashboard/profiles_controller_spec.rb +5 -5
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +7 -19
- data/spec/controllers/hyrax/fixity_checks_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +1 -3
- data/spec/controllers/hyrax/single_use_links_viewer_controller_spec.rb +2 -4
- data/spec/factories/admin_sets.rb +0 -4
- data/spec/forms/hyrax/forms/work_form_spec.rb +41 -0
- data/spec/helpers/hyrax/content_block_helper_spec.rb +6 -0
- data/spec/helpers/hyrax_helper_spec.rb +0 -13
- data/spec/indexers/hyrax/generic_work_indexer_spec.rb +4 -1
- data/spec/javascripts/autocomplete_spec.js.coffee +39 -4
- data/spec/jobs/fixity_check_job_spec.rb +1 -2
- data/spec/lib/hyrax/configuration_spec.rb +4 -2
- data/spec/models/admin_set_spec.rb +0 -24
- data/spec/models/collection_spec.rb +0 -13
- data/spec/models/file_set_spec.rb +0 -17
- data/spec/models/generic_work_spec.rb +0 -11
- data/spec/models/solr_document_spec.rb +0 -32
- data/spec/models/user_spec.rb +20 -5
- data/spec/presenters/hyrax/file_usage_spec.rb +3 -7
- data/spec/services/hyrax/admin_set_create_service_spec.rb +2 -2
- data/spec/services/hyrax/admin_set_service_spec.rb +2 -2
- data/spec/services/hyrax/change_content_depositor_service_spec.rb +2 -6
- data/spec/services/hyrax/collections_service_spec.rb +1 -1
- data/spec/services/hyrax/default_middleware_stack_spec.rb +1 -0
- data/spec/services/hyrax/import_url_failure_service_spec.rb +1 -3
- data/spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb +2 -1
- data/spec/services/hyrax/repository_fixity_check_service_spec.rb +1 -3
- data/spec/services/hyrax/{query_service_spec.rb → statistics/query_service_spec.rb} +5 -3
- data/spec/services/hyrax/versioning_service_spec.rb +2 -5
- data/spec/services/hyrax/work_query_service_spec.rb +1 -1
- data/spec/services/hyrax/workflow/status_list_service_spec.rb +7 -2
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +1 -4
- data/spec/views/hyrax/base/_form.html.erb_spec.rb +4 -11
- data/spec/views/hyrax/base/_form_progress.html.erb_spec.rb +14 -0
- data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb +24 -0
- data/spec/views/hyrax/dashboard/show_user_spec.rb +24 -0
- data/template.rb +1 -1
- metadata +18 -13
- data/app/services/hyrax/query_service.rb +0 -53
@@ -10,6 +10,12 @@ RSpec.describe Hyrax::ContentBlockHelper, type: :helper do
|
|
10
10
|
expect(helper).to respond_to(:displayable_content_block)
|
11
11
|
end
|
12
12
|
|
13
|
+
context 'when a block is nil' do
|
14
|
+
let(:content_block) { nil }
|
15
|
+
|
16
|
+
it { is_expected.to be_nil }
|
17
|
+
end
|
18
|
+
|
13
19
|
context 'when a block has a nil value' do
|
14
20
|
let(:content_block) { double(value: nil) }
|
15
21
|
|
@@ -283,19 +283,6 @@ RSpec.describe HyraxHelper, type: :helper do
|
|
283
283
|
end
|
284
284
|
end
|
285
285
|
|
286
|
-
describe '#browser_supports_directory_upload?' do
|
287
|
-
subject { helper.browser_supports_directory_upload? }
|
288
|
-
|
289
|
-
context 'with Chrome' do
|
290
|
-
before { controller.request.env['HTTP_USER_AGENT'] = 'Chrome' }
|
291
|
-
it { is_expected.to be true }
|
292
|
-
end
|
293
|
-
context 'with a non-chrome browser' do
|
294
|
-
before { controller.request.env['HTTP_USER_AGENT'] = 'Firefox' }
|
295
|
-
it { is_expected.to be false }
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
286
|
describe '#zotero_label' do
|
300
287
|
subject { helper }
|
301
288
|
|
@@ -89,7 +89,10 @@ RSpec.describe GenericWorkIndexer do
|
|
89
89
|
.and_return(['approve', 'reject'])
|
90
90
|
end
|
91
91
|
it "indexed the roles and state" do
|
92
|
-
expect(solr_document.fetch('actionable_workflow_roles_ssim')).to eq [
|
92
|
+
expect(solr_document.fetch('actionable_workflow_roles_ssim')).to eq [
|
93
|
+
"#{sipity_entity.workflow.permission_template.admin_set_id}-#{sipity_entity.workflow.name}-approve",
|
94
|
+
"#{sipity_entity.workflow.permission_template.admin_set_id}-#{sipity_entity.workflow.name}-reject"
|
95
|
+
]
|
93
96
|
expect(solr_document.fetch('workflow_state_name_ssim')).to eq "initial"
|
94
97
|
end
|
95
98
|
end
|
@@ -15,6 +15,45 @@ describe "auto complete", ->
|
|
15
15
|
#undefine the jasmine clock so time goes back to normal
|
16
16
|
jasmine.clock().uninstall()
|
17
17
|
|
18
|
+
describe "title", ->
|
19
|
+
beforeEach ->
|
20
|
+
# setup two inputs for us to attach auto complete to
|
21
|
+
setFixtures '<form data-behavior="work-form">
|
22
|
+
<input class="generic_work_title" value="" id="generic_work_title" type="text">
|
23
|
+
<input class="generic_work_title" value="" type="text">
|
24
|
+
</form>'
|
25
|
+
|
26
|
+
# run all Blacklight.onload functions
|
27
|
+
Blacklight.activate()
|
28
|
+
|
29
|
+
describe "first input", ->
|
30
|
+
# field doesn't trigger auto complete
|
31
|
+
it "does not auto complete on typing", ->
|
32
|
+
# send a key stroke to the target input to activate the auto complete
|
33
|
+
target = $($("input.generic_work_title")[0])
|
34
|
+
target.val('fre')
|
35
|
+
target.trigger(@typeEvent)
|
36
|
+
|
37
|
+
# move time along so that events have a chance to happen
|
38
|
+
jasmine.clock().tick(800)
|
39
|
+
|
40
|
+
# verify that the ajax call was made
|
41
|
+
expect(@spy_on_json).not.toHaveBeenCalled()
|
42
|
+
|
43
|
+
describe "second input", ->
|
44
|
+
# field doesn't trigger auto complete
|
45
|
+
it "does not auto complete on typing", ->
|
46
|
+
# send a key stroke to the target input to activate the auto complete
|
47
|
+
target = $($("input.generic_work_title")[1])
|
48
|
+
target.val('fre')
|
49
|
+
target.trigger(@typeEvent)
|
50
|
+
|
51
|
+
# move time along so that events have a chance to happen
|
52
|
+
jasmine.clock().tick(800)
|
53
|
+
|
54
|
+
# verify that the ajax call was not made
|
55
|
+
expect(@spy_on_json).not.toHaveBeenCalled()
|
56
|
+
|
18
57
|
describe "language", ->
|
19
58
|
beforeEach ->
|
20
59
|
# setup two inputs for us to attach auto complete to
|
@@ -41,7 +80,6 @@ describe "auto complete", ->
|
|
41
80
|
# verify that the ajax call was made
|
42
81
|
expect(@spy_on_json).toHaveBeenCalled()
|
43
82
|
|
44
|
-
|
45
83
|
describe "second input", ->
|
46
84
|
|
47
85
|
# field triggers auto complete
|
@@ -83,7 +121,6 @@ describe "auto complete", ->
|
|
83
121
|
# verify that the ajax call was made
|
84
122
|
expect(@spy_on_json).toHaveBeenCalled()
|
85
123
|
|
86
|
-
|
87
124
|
describe "second input", ->
|
88
125
|
|
89
126
|
# field triggers auto complete
|
@@ -99,7 +136,6 @@ describe "auto complete", ->
|
|
99
136
|
# verify that the ajax call was made
|
100
137
|
expect(@spy_on_json).toHaveBeenCalled()
|
101
138
|
|
102
|
-
|
103
139
|
describe "location", ->
|
104
140
|
beforeEach ->
|
105
141
|
# setup two inputs for us to attach auto complete to
|
@@ -126,7 +162,6 @@ describe "auto complete", ->
|
|
126
162
|
# verify that the ajax call was made
|
127
163
|
expect(@spy_on_json).toHaveBeenCalled()
|
128
164
|
|
129
|
-
|
130
165
|
describe "second input", ->
|
131
166
|
|
132
167
|
# field triggers auto complete
|
@@ -2,8 +2,7 @@ RSpec.describe FixityCheckJob do
|
|
2
2
|
let(:user) { create(:user) }
|
3
3
|
|
4
4
|
let(:file_set) do
|
5
|
-
|
6
|
-
file.apply_depositor_metadata(user)
|
5
|
+
create(:file_set, user: user).tap do |file|
|
7
6
|
Hydra::Works::AddFileToFileSet.call(file, File.open(fixture_path + '/world.png'), :original_file, versioning: true)
|
8
7
|
end
|
9
8
|
end
|
@@ -18,8 +18,8 @@ RSpec.describe Hyrax::Configuration do
|
|
18
18
|
it { is_expected.to respond_to(:active_deposit_agreement_acceptance?) }
|
19
19
|
it { is_expected.to respond_to(:active_deposit_agreement_acceptance=) }
|
20
20
|
it { is_expected.to respond_to(:activity_to_show_default_seconds_since_now) }
|
21
|
-
it { is_expected.to respond_to(:
|
22
|
-
it { is_expected.to respond_to(:
|
21
|
+
it { is_expected.to respond_to(:admin_set_predicate) }
|
22
|
+
it { is_expected.to respond_to(:admin_set_predicate=) }
|
23
23
|
it { is_expected.to respond_to(:analytic_start_date) }
|
24
24
|
it { is_expected.to respond_to(:analytics?) }
|
25
25
|
it { is_expected.to respond_to(:analytics) }
|
@@ -59,4 +59,6 @@ RSpec.describe Hyrax::Configuration do
|
|
59
59
|
it { is_expected.to respond_to(:upload_path) }
|
60
60
|
it { is_expected.to respond_to(:work_requires_files?) }
|
61
61
|
it { is_expected.to respond_to(:extract_full_text?) }
|
62
|
+
it { is_expected.to respond_to(:whitelisted_ingest_dirs) }
|
63
|
+
it { is_expected.to respond_to(:whitelisted_ingest_dirs=) }
|
62
64
|
end
|
@@ -97,30 +97,6 @@ RSpec.describe AdminSet, type: :model do
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
it "has a title that is an ActiveTriples::Relation" do
|
101
|
-
subject.title = ['Hello World']
|
102
|
-
expect(subject.title).to eq(['Hello World'])
|
103
|
-
expect(subject.title).to be_a(ActiveTriples::Relation)
|
104
|
-
end
|
105
|
-
|
106
|
-
it "has a description that is an ActiveTriples::Relation" do
|
107
|
-
subject.description = ['My description']
|
108
|
-
expect(subject.description).to eq(['My description'])
|
109
|
-
expect(subject.description).to be_a(ActiveTriples::Relation)
|
110
|
-
end
|
111
|
-
|
112
|
-
describe '#title=' do
|
113
|
-
it 'raises an error if set with a String' do
|
114
|
-
expect { subject.title = 'New Title' }.to raise_error(ArgumentError)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
describe '#description=' do
|
119
|
-
it 'raises an error if set with a String' do
|
120
|
-
expect { subject.description = 'New Description' }.to raise_error(ArgumentError)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
100
|
describe ".default_set?" do
|
125
101
|
context "with default AdminSet ID" do
|
126
102
|
it "returns true" do
|
@@ -58,19 +58,6 @@ RSpec.describe Collection do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
it "has a title", clean_repo: true do
|
62
|
-
subject.title = ["title"]
|
63
|
-
subject.save!
|
64
|
-
expect(subject.reload.title).to eq ["title"]
|
65
|
-
end
|
66
|
-
|
67
|
-
it "has a description", clean_repo: true do
|
68
|
-
subject.title = ["title"] # Because the title is required
|
69
|
-
subject.description = ["description"]
|
70
|
-
subject.save!
|
71
|
-
expect(subject.reload.description).to eq ["description"]
|
72
|
-
end
|
73
|
-
|
74
61
|
describe "#destroy", clean_repo: true do
|
75
62
|
let(:collection) { build(:collection) }
|
76
63
|
let(:work1) { create(:work) }
|
@@ -296,23 +296,6 @@ RSpec.describe FileSet do
|
|
296
296
|
subject.read_groups = ['group-2', 'group-3']
|
297
297
|
expect(subject.read_groups).to eq ['group-2', 'group-3']
|
298
298
|
end
|
299
|
-
|
300
|
-
it 'has read groups string writer' do
|
301
|
-
subject.read_groups_string = 'umg/up.dlt.staff, group-3'
|
302
|
-
expect(subject.read_groups).to eq ['umg/up.dlt.staff', 'group-3']
|
303
|
-
expect(subject.edit_groups).to eq ['group-8']
|
304
|
-
expect(subject.read_users).to eq %w[person1 person2]
|
305
|
-
expect(subject.edit_users).to eq ['jcoyne']
|
306
|
-
end
|
307
|
-
|
308
|
-
it 'revokes only eligible groups' do
|
309
|
-
subject.set_read_groups(['group-2', 'group-3'], ['group-6'])
|
310
|
-
# 'group-7' is not eligible to be revoked
|
311
|
-
expect(subject.read_groups).to match_array ['group-2', 'group-3', 'group-7']
|
312
|
-
expect(subject.edit_groups).to eq ['group-8']
|
313
|
-
expect(subject.read_users).to match_array %w[person1 person2]
|
314
|
-
expect(subject.edit_users).to eq ['jcoyne']
|
315
|
-
end
|
316
299
|
end
|
317
300
|
|
318
301
|
describe 'permissions validation' do
|
@@ -74,17 +74,6 @@ RSpec.describe GenericWork do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
describe "created for someone (proxy)" do
|
78
|
-
let(:work) { described_class.new(title: ['demoname']) { |gw| gw.apply_depositor_metadata("user") } }
|
79
|
-
let(:transfer_to) { create(:user) }
|
80
|
-
|
81
|
-
it "transfers the request" do
|
82
|
-
work.on_behalf_of = transfer_to.user_key
|
83
|
-
expect(ContentDepositorChangeEventJob).to receive(:perform_later).once
|
84
|
-
work.save!
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
77
|
describe "delegations" do
|
89
78
|
let(:work) { described_class.new { |gw| gw.apply_depositor_metadata("user") } }
|
90
79
|
let(:proxy_depositor) { create(:user) }
|
@@ -155,38 +155,6 @@ RSpec.describe ::SolrDocument, type: :model do
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
-
describe '#collections' do
|
159
|
-
subject { document.collections }
|
160
|
-
|
161
|
-
context 'when the object belongs to a collection' do
|
162
|
-
let(:coll_id) { '456' }
|
163
|
-
let(:attributes) do
|
164
|
-
{ id: '123',
|
165
|
-
title_tesim: ['A generic work'],
|
166
|
-
collection_ids_tesim: [coll_id] }
|
167
|
-
end
|
168
|
-
|
169
|
-
let(:coll_attrs) { { id: coll_id, title_tesim: ['A Collection'] } }
|
170
|
-
|
171
|
-
before do
|
172
|
-
ActiveFedora::SolrService.add(coll_attrs)
|
173
|
-
ActiveFedora::SolrService.commit
|
174
|
-
end
|
175
|
-
|
176
|
-
it 'returns the solr docs for the collections' do
|
177
|
-
expect(subject.count).to eq 1
|
178
|
-
solr_doc = subject.first
|
179
|
-
expect(solr_doc).to be_kind_of described_class
|
180
|
-
expect(solr_doc['id']).to eq coll_id
|
181
|
-
expect(solr_doc['title_tesim']).to eq coll_attrs[:title_tesim]
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
context 'when the object does not belong to any collections' do
|
186
|
-
it { is_expected.to eq [] }
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
158
|
describe "#height" do
|
191
159
|
let(:attributes) { { height_is: '444' } }
|
192
160
|
|
data/spec/models/user_spec.rb
CHANGED
@@ -96,21 +96,36 @@ RSpec.describe User, type: :model do
|
|
96
96
|
expect(user).to be_valid
|
97
97
|
expect(user.save).to be true
|
98
98
|
end
|
99
|
-
it 'saves when a valid ORCID URI is supplied' do
|
100
|
-
user.orcid = 'http://orcid.org/0000-0000-1111-2222'
|
99
|
+
it 'saves when a valid ORCID HTTP URI w/ trailing slash is supplied' do
|
100
|
+
user.orcid = 'http://orcid.org/0000-0000-1111-2222/'
|
101
101
|
expect(user).to be_valid
|
102
102
|
expect(user.save).to be true
|
103
103
|
end
|
104
|
-
it '
|
104
|
+
it 'saves when a valid ORCID HTTPS URI is supplied' do
|
105
|
+
user.orcid = 'https://orcid.org/0000-0000-1111-2222'
|
106
|
+
expect(user).to be_valid
|
107
|
+
expect(user.save).to be true
|
108
|
+
end
|
109
|
+
it 'normalizes bare ORCIDs to HTTPS URIs' do
|
105
110
|
user.orcid = '0000-0000-1111-2222'
|
106
111
|
user.save
|
107
|
-
expect(user.orcid).to eq '
|
112
|
+
expect(user.orcid).to eq 'https://orcid.org/0000-0000-1111-2222'
|
113
|
+
end
|
114
|
+
it 'normalizes HTTP ORCIDs to HTTPS URIs' do
|
115
|
+
user.orcid = 'http://orcid.org/0000-0000-1111-2222'
|
116
|
+
user.save
|
117
|
+
expect(user.orcid).to eq 'https://orcid.org/0000-0000-1111-2222'
|
108
118
|
end
|
109
|
-
it 'marks
|
119
|
+
it 'marks short ORCIDs as invalid' do
|
110
120
|
user.orcid = '000-000-111-222'
|
111
121
|
expect(user).not_to be_valid
|
112
122
|
expect(user.save).to be false
|
113
123
|
end
|
124
|
+
it 'marks long ORCIDs as invalid' do
|
125
|
+
user.orcid = '0000-0000-1111-222222'
|
126
|
+
expect(user).not_to be_valid
|
127
|
+
expect(user.save).to be false
|
128
|
+
end
|
114
129
|
end
|
115
130
|
|
116
131
|
describe "#to_param" do
|
@@ -1,8 +1,7 @@
|
|
1
1
|
RSpec.describe Hyrax::FileUsage, type: :model do
|
2
|
+
let(:user) { build(:user) }
|
2
3
|
let(:file) do
|
3
|
-
|
4
|
-
file.apply_depositor_metadata("awead")
|
5
|
-
end
|
4
|
+
create(:file_set, user: user)
|
6
5
|
end
|
7
6
|
|
8
7
|
let(:dates) do
|
@@ -148,11 +147,8 @@ RSpec.describe Hyrax::FileUsage, type: :model do
|
|
148
147
|
|
149
148
|
describe "on a migrated file" do
|
150
149
|
let(:date_uploaded) { "2014-12-31" }
|
151
|
-
|
152
150
|
let(:file_migrated) do
|
153
|
-
|
154
|
-
file.apply_depositor_metadata("awead")
|
155
|
-
end
|
151
|
+
create(:file_set, date_uploaded: date_uploaded, user: user)
|
156
152
|
end
|
157
153
|
|
158
154
|
let(:usage) do
|
@@ -16,7 +16,7 @@ RSpec.describe Hyrax::AdminSetCreateService do
|
|
16
16
|
# * 1 depositing role for the registered group in the default workflow, equals
|
17
17
|
# * 7
|
18
18
|
expect(Sipity::WorkflowResponsibility.count).to eq 7
|
19
|
-
expect(admin_set.read_groups).
|
19
|
+
expect(admin_set.read_groups).not_to include('public')
|
20
20
|
expect(admin_set.edit_groups).to eq ['admin']
|
21
21
|
# 2 access grants because:
|
22
22
|
# * 1 providing deposit access to registered group
|
@@ -85,7 +85,7 @@ RSpec.describe Hyrax::AdminSetCreateService do
|
|
85
85
|
# * 2 available workflows, multiplied by
|
86
86
|
# * 3 roles (from Hyrax::RoleRegistry), equals
|
87
87
|
# * 12
|
88
|
-
expect(admin_set.read_groups).
|
88
|
+
expect(admin_set.read_groups).not_to include('public')
|
89
89
|
expect(admin_set.edit_groups).to eq ['admin']
|
90
90
|
expect(admin_set.creator).to eq [user.user_key]
|
91
91
|
expect(workflow_importer).to have_received(:call).with(permission_template: permission_template)
|
@@ -11,8 +11,8 @@ RSpec.describe Hyrax::AdminSetService do
|
|
11
11
|
describe "#search_results", :clean_repo do
|
12
12
|
subject { service.search_results(access) }
|
13
13
|
|
14
|
-
let!(:as1) { create(:admin_set, :public, title: ['foo']) }
|
15
|
-
let!(:as2) { create(:admin_set, :public, title: ['bar']) }
|
14
|
+
let!(:as1) { create(:admin_set, read_groups: ['public'], title: ['foo']) }
|
15
|
+
let!(:as2) { create(:admin_set, read_groups: ['public'], title: ['bar']) }
|
16
16
|
let!(:as3) { create(:admin_set, edit_users: [user.user_key], title: ['baz']) }
|
17
17
|
|
18
18
|
before do
|
@@ -2,14 +2,10 @@ RSpec.describe Hyrax::ChangeContentDepositorService do
|
|
2
2
|
let!(:depositor) { create(:user) }
|
3
3
|
let!(:receiver) { create(:user) }
|
4
4
|
let!(:file) do
|
5
|
-
|
6
|
-
f.apply_depositor_metadata(depositor.user_key)
|
7
|
-
end
|
5
|
+
create(:file_set, user: depositor)
|
8
6
|
end
|
9
7
|
let!(:work) do
|
10
|
-
|
11
|
-
w.apply_depositor_metadata(depositor.user_key)
|
12
|
-
end
|
8
|
+
create(:work, title: ['Test work'], user: depositor)
|
13
9
|
end
|
14
10
|
|
15
11
|
before do
|
@@ -18,7 +18,7 @@ RSpec.describe Hyrax::CollectionsService do
|
|
18
18
|
let!(:collection3) { create(:collection, :public, edit_users: [user.user_key], title: ['baz']) }
|
19
19
|
|
20
20
|
before do
|
21
|
-
create(:admin_set, :public) # this should never be returned.
|
21
|
+
create(:admin_set, read_groups: ['public']) # this should never be returned.
|
22
22
|
end
|
23
23
|
|
24
24
|
context "with read access" do
|
@@ -17,6 +17,7 @@ RSpec.describe Hyrax::DefaultMiddlewareStack do
|
|
17
17
|
Hyrax::Actors::AttachMembersActor,
|
18
18
|
Hyrax::Actors::ApplyOrderActor,
|
19
19
|
Hyrax::Actors::InterpretVisibilityActor,
|
20
|
+
Hyrax::Actors::TransferRequestActor,
|
20
21
|
Hyrax::Actors::DefaultAdminSetActor,
|
21
22
|
Hyrax::Actors::ApplyPermissionTemplateActor,
|
22
23
|
Hyrax::Actors::CleanupFileSetsActor,
|
@@ -3,9 +3,7 @@ RSpec.describe Hyrax::ImportUrlFailureService do
|
|
3
3
|
let!(:depositor) { create(:user) }
|
4
4
|
let(:inbox) { depositor.mailbox.inbox }
|
5
5
|
let(:file) do
|
6
|
-
|
7
|
-
file.apply_depositor_metadata(depositor)
|
8
|
-
end
|
6
|
+
create(:file_set, user: depositor)
|
9
7
|
end
|
10
8
|
|
11
9
|
before do
|
@@ -1,6 +1,7 @@
|
|
1
1
|
RSpec.describe Hyrax::PersistDirectlyContainedOutputFileService do
|
2
2
|
# PersistDirectlyContainedOutputFileService is used by FullTextExtract.output_file_service
|
3
|
-
let(:file_set) {
|
3
|
+
let(:file_set) { create(:file_set, user: user) }
|
4
|
+
let(:user) { build(:user) }
|
4
5
|
let(:content) { "fake file content" }
|
5
6
|
let(:resource) { file_set.reload.extracted_text }
|
6
7
|
|