hyrax 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +139 -69
- data/.travis.yml +4 -1
- data/README.md +2 -2
- data/app/actors/hyrax/actors/transactional_request.rb +8 -8
- data/app/services/hyrax/default_middleware_stack.rb +4 -2
- data/app/views/catalog/_thumbnail_list_collection.html.erb +3 -2
- data/hyrax.gemspec +3 -6
- data/lib/hyrax/version.rb +1 -1
- data/spec/abilities/collection_ability_spec.rb +5 -5
- data/spec/abilities/permission_template_ability_spec.rb +1 -1
- data/spec/actors/hyrax/actors/collections_membership_actor_spec.rb +5 -5
- data/spec/actors/hyrax/actors/transactional_request_spec.rb +4 -2
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +9 -9
- data/spec/controllers/hyrax/collections_controller_spec.rb +5 -5
- data/spec/controllers/hyrax/dashboard/collection_members_controller_spec.rb +16 -13
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +8 -8
- data/spec/controllers/hyrax/dashboard/nest_collections_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/my/shares_controller_spec.rb +1 -1
- data/spec/features/actor_stack_spec.rb +48 -0
- data/spec/features/catalog_search_spec.rb +2 -2
- data/spec/features/collection_multi_membership_spec.rb +2 -2
- data/spec/features/collection_spec.rb +7 -7
- data/spec/features/collection_type_spec.rb +2 -2
- data/spec/features/dashboard/collection_spec.rb +15 -15
- data/spec/features/search_spec.rb +2 -2
- data/spec/features/work_show_spec.rb +5 -2
- data/spec/forms/hyrax/forms/collection_form_spec.rb +5 -5
- data/spec/forms/hyrax/forms/permission_template_form_spec.rb +1 -1
- data/spec/indexers/hyrax/collection_indexer_spec.rb +1 -1
- data/spec/jobs/characterize_job_spec.rb +1 -1
- data/spec/lib/hyrax/resource_sync/change_list_writer_spec.rb +35 -21
- data/spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb +1 -1
- data/spec/models/collection_spec.rb +18 -18
- data/spec/models/concerns/hyrax/collection_nesting_spec.rb +2 -2
- data/spec/models/hyrax/collection_type_spec.rb +2 -2
- data/spec/presenters/hyrax/collection_presenter_spec.rb +11 -11
- data/spec/search_builders/hyrax/collection_member_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/collection_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/dashboard/nested_collections_search_builder_spec.rb +1 -1
- data/spec/search_builders/hyrax/work_relation_spec.rb +1 -1
- data/spec/services/hyrax/adapters/nesting_index_adapter_spec.rb +2 -2
- data/spec/services/hyrax/collections/collection_member_service_spec.rb +2 -2
- data/spec/services/hyrax/collections/migration_service_spec.rb +27 -27
- data/spec/services/hyrax/collections/nested_collection_persistence_service_spec.rb +1 -1
- data/spec/services/hyrax/collections/nested_collection_query_service_spec.rb +38 -38
- data/spec/services/hyrax/statistics/depositors/summary_spec.rb +1 -1
- data/spec/services/hyrax/statistics/works/by_resource_type_spec.rb +11 -4
- data/spec/spec_helper.rb +10 -8
- data/spec/support/selectors.rb +10 -1
- data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +38 -5
- data/template.rb +3 -1
- metadata +23 -21
@@ -61,7 +61,7 @@ RSpec.describe Hyrax::Dashboard::NestedCollectionsSearchBuilder do
|
|
61
61
|
|
62
62
|
context 'when access is :deposit' do
|
63
63
|
let(:access) { "deposit" }
|
64
|
-
let!(:collection) { create(:
|
64
|
+
let!(:collection) { create(:collection_lw, with_permission_template: attributes) }
|
65
65
|
|
66
66
|
context 'and user has access' do
|
67
67
|
let(:attributes) { { deposit_users: [user.user_key] } }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
RSpec.describe Hyrax::WorkRelation, :clean_repo do
|
2
2
|
let!(:work) { create(:generic_work) }
|
3
3
|
let!(:file_set) { create(:file_set) }
|
4
|
-
let!(:collection) {
|
4
|
+
let!(:collection) { build(:collection_lw) }
|
5
5
|
|
6
6
|
it 'has works and not collections or file sets' do
|
7
7
|
expect(subject).to eq [work]
|
@@ -64,8 +64,8 @@ RSpec.describe Hyrax::Adapters::NestingIndexAdapter do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
describe '.each_perservation_document_id_and_parent_ids', clean_repo: true do
|
67
|
-
let!(:nested_parent) {
|
68
|
-
let!(:nested_with_parent) { create(:
|
67
|
+
let!(:nested_parent) { build(:collection_lw, member_of_collections: []) }
|
68
|
+
let!(:nested_with_parent) { create(:collection_lw, member_of_collections: [nested_parent]) }
|
69
69
|
let!(:work) { create(:generic_work) }
|
70
70
|
let(:count_of_items) { ActiveFedora::Base.descendant_uris(ActiveFedora.fedora.base_uri, exclude_uri: true).count }
|
71
71
|
|
@@ -2,9 +2,9 @@ RSpec.describe Hyrax::Collections::CollectionMemberService, clean_repo: true do
|
|
2
2
|
let(:blacklight_config) { CatalogController.blacklight_config }
|
3
3
|
let(:repository) { Blacklight::Solr::Repository.new(blacklight_config) }
|
4
4
|
let(:current_ability) { instance_double(Ability, admin?: true) }
|
5
|
-
let!(:nestable_collection) { create(:
|
5
|
+
let!(:nestable_collection) { create(:public_collection_lw, collection_type_settings: [:nestable]) }
|
6
6
|
let(:scope) { double('Scope', current_ability: current_ability, repository: repository, blacklight_config: blacklight_config, collection: nestable_collection) }
|
7
|
-
let!(:subcollection) { create(:
|
7
|
+
let!(:subcollection) { create(:public_collection_lw, member_of_collections: [nestable_collection], collection_type_settings: [:nestable]) }
|
8
8
|
let(:builder) { described_class.new(scope: scope, collection: nestable_collection, params: { "id" => nestable_collection.id.to_s }) }
|
9
9
|
|
10
10
|
let!(:work1) { create(:generic_work, member_of_collections: [nestable_collection]) }
|
@@ -14,11 +14,11 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
14
14
|
|
15
15
|
describe ".migrate_all_collections" do
|
16
16
|
context 'when legacy collections are found (e.g. collections created before Hyrax 2.1.0)' do
|
17
|
-
let!(:col_none) { build(:typeless_collection,
|
18
|
-
let!(:col_vu) { build(:typeless_collection,
|
19
|
-
let!(:col_vg) { build(:typeless_collection,
|
20
|
-
let!(:col_mu) { build(:typeless_collection,
|
21
|
-
let!(:col_mg) { build(:typeless_collection,
|
17
|
+
let!(:col_none) { build(:typeless_collection, user: user, edit_users: [user.user_key], do_save: true) }
|
18
|
+
let!(:col_vu) { build(:typeless_collection, user: user, edit_users: [user.user_key], read_users: [reader1.user_key, reader2.user_key], do_save: true) }
|
19
|
+
let!(:col_vg) { build(:typeless_collection, user: user, edit_users: [user.user_key], read_groups: ['read_group_1', 'read_group_2'], do_save: true) }
|
20
|
+
let!(:col_mu) { build(:typeless_collection, user: user, edit_users: [user.user_key, editor1.user_key, editor2.user_key], do_save: true) }
|
21
|
+
let!(:col_mg) { build(:typeless_collection, user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'], do_save: true) }
|
22
22
|
|
23
23
|
it 'sets gid and adds permissions' do # rubocop:disable RSpec/ExampleLength
|
24
24
|
Collection.all.each do |col|
|
@@ -158,11 +158,11 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
158
158
|
let!(:col_mg) { build(:typeless_collection, id: 'col_mg', user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'], do_save: true) }
|
159
159
|
|
160
160
|
context "and collection wasn't migrated at all" do
|
161
|
-
let!(:col_none) { build(:
|
162
|
-
let!(:col_vu) { build(:
|
163
|
-
let!(:col_vg) { build(:
|
164
|
-
let!(:col_mu) { build(:
|
165
|
-
let!(:col_mg) { build(:
|
161
|
+
let!(:col_none) { build(:typeless_collection_lw, user: user, edit_users: [user.user_key], read_users: [], do_save: true) }
|
162
|
+
let!(:col_vu) { build(:typeless_collection_lw, user: user, edit_users: [user.user_key], read_users: [reader1.user_key, reader2.user_key], do_save: true) }
|
163
|
+
let!(:col_vg) { build(:typeless_collection_lw, user: user, edit_users: [user.user_key], read_groups: ['read_group_1', 'read_group_2'], do_save: true) }
|
164
|
+
let!(:col_mu) { build(:typeless_collection_lw, user: user, edit_users: [user.user_key, editor1.user_key, editor2.user_key], do_save: true) }
|
165
|
+
let!(:col_mg) { build(:typeless_collection_lw, user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'], do_save: true) }
|
166
166
|
|
167
167
|
it 'sets gid and adds permissions' do # rubocop:disable RSpec/ExampleLength
|
168
168
|
Collection.all.each do |col|
|
@@ -185,11 +185,11 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
185
185
|
end
|
186
186
|
|
187
187
|
context "and collection type gid is set but permission template doesn't exist" do
|
188
|
-
let!(:col_none) {
|
189
|
-
let!(:col_vu) {
|
190
|
-
let!(:col_vg) {
|
191
|
-
let!(:col_mu) {
|
192
|
-
let!(:col_mg) {
|
188
|
+
let!(:col_none) { build(:user_collection_lw, id: 'col_none', user: user, edit_users: [user.user_key], collection_type_gid: default_gid) }
|
189
|
+
let!(:col_vu) { build(:user_collection_lw, id: 'col_vu', user: user, edit_users: [user.user_key], read_users: [reader1.user_key, reader2.user_key], collection_type_gid: default_gid) }
|
190
|
+
let!(:col_vg) { build(:user_collection_lw, id: 'col_vg', user: user, edit_users: [user.user_key], read_groups: ['read_group_1', 'read_group_2'], collection_type_gid: default_gid) }
|
191
|
+
let!(:col_mu) { build(:user_collection_lw, id: 'col_mu', user: user, edit_users: [user.user_key, editor1.user_key, editor2.user_key], collection_type_gid: default_gid) }
|
192
|
+
let!(:col_mg) { build(:user_collection_lw, id: 'col_mg', user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'], collection_type_gid: default_gid) }
|
193
193
|
|
194
194
|
it 'sets gid and adds permissions' do # rubocop:disable RSpec/ExampleLength
|
195
195
|
Collection.all.each do |col|
|
@@ -212,21 +212,21 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
212
212
|
end
|
213
213
|
|
214
214
|
context "and collection type gid isn't set but permission template exists with access set" do
|
215
|
-
let!(:col_none) { build(:typeless_collection,
|
215
|
+
let!(:col_none) { build(:typeless_collection, user: user, edit_users: [user.user_key], do_save: true, with_permission_template: true) }
|
216
216
|
let!(:col_vu) do
|
217
|
-
build(:typeless_collection,
|
217
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], read_users: [reader1.user_key, reader2.user_key],
|
218
218
|
do_save: true, with_permission_template: true)
|
219
219
|
end
|
220
220
|
let!(:col_vg) do
|
221
|
-
build(:typeless_collection,
|
221
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], read_groups: ['read_group_1', 'read_group_2'],
|
222
222
|
do_save: true, with_permission_template: true)
|
223
223
|
end
|
224
224
|
let!(:col_mu) do
|
225
|
-
build(:typeless_collection,
|
225
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key, editor1.user_key, editor2.user_key],
|
226
226
|
do_save: true, with_permission_template: true)
|
227
227
|
end
|
228
228
|
let!(:col_mg) do
|
229
|
-
build(:typeless_collection,
|
229
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'],
|
230
230
|
do_save: true, with_permission_template: true)
|
231
231
|
end
|
232
232
|
|
@@ -276,21 +276,21 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
276
276
|
end
|
277
277
|
|
278
278
|
context "and collection type gid isn't set and permission template exists with access not set" do
|
279
|
-
let!(:col_none) { build(:typeless_collection,
|
279
|
+
let!(:col_none) { build(:typeless_collection, user: user, edit_users: [user.user_key], do_save: true, with_permission_template: true) }
|
280
280
|
let!(:col_vu) do
|
281
|
-
build(:typeless_collection,
|
281
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], read_users: [reader1.user_key, reader2.user_key],
|
282
282
|
do_save: true, with_permission_template: true)
|
283
283
|
end
|
284
284
|
let!(:col_vg) do
|
285
|
-
build(:typeless_collection,
|
285
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], read_groups: ['read_group_1', 'read_group_2'],
|
286
286
|
do_save: true, with_permission_template: true)
|
287
287
|
end
|
288
288
|
let!(:col_mu) do
|
289
|
-
build(:typeless_collection,
|
289
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key, editor1.user_key, editor2.user_key],
|
290
290
|
do_save: true, with_permission_template: true)
|
291
291
|
end
|
292
292
|
let!(:col_mg) do
|
293
|
-
build(:typeless_collection,
|
293
|
+
build(:typeless_collection, user: user, edit_users: [user.user_key], edit_groups: ['edit_group_1', 'edit_group_2'],
|
294
294
|
do_save: true, with_permission_template: true)
|
295
295
|
end
|
296
296
|
|
@@ -322,8 +322,8 @@ RSpec.describe Hyrax::Collections::MigrationService, clean_repo: true do
|
|
322
322
|
|
323
323
|
context 'when newer collections are found (e.g. collections created at or after Hyrax 2.1.0)' do
|
324
324
|
let!(:collection) do
|
325
|
-
|
326
|
-
|
325
|
+
build(:collection_lw, id: 'col_newer', user: user, with_permission_template: true, collection_type_settings: [:discoverable],
|
326
|
+
edit_users: [user.user_key])
|
327
327
|
end
|
328
328
|
let!(:permission_template) { collection.permission_template }
|
329
329
|
let!(:collection_type_gid) { collection.collection_type_gid }
|
@@ -153,57 +153,57 @@ RSpec.describe Hyrax::Collections::NestedCollectionQueryService, clean_repo: tru
|
|
153
153
|
|
154
154
|
# using create option here because permission template is required for testing :deposit access
|
155
155
|
let(:coll_a) do
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
156
|
+
build(:public_collection_lw,
|
157
|
+
id: 'Collection_A',
|
158
|
+
collection_type_gid: collection_type.gid,
|
159
|
+
user: user,
|
160
|
+
with_permission_template: true)
|
161
161
|
end
|
162
162
|
let(:coll_b) do
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
163
|
+
build(:public_collection_lw,
|
164
|
+
id: 'Collection_B',
|
165
|
+
collection_type_gid: collection_type.gid,
|
166
|
+
user: user,
|
167
|
+
with_permission_template: true,
|
168
|
+
member_of_collections: [coll_a])
|
169
169
|
end
|
170
170
|
let(:coll_c) do
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
171
|
+
build(:public_collection_lw,
|
172
|
+
id: 'Collection_C',
|
173
|
+
collection_type_gid: collection_type.gid,
|
174
|
+
user: user,
|
175
|
+
with_permission_template: true,
|
176
|
+
member_of_collections: [coll_b])
|
177
177
|
end
|
178
178
|
let(:coll_d) do
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
179
|
+
build(:public_collection_lw,
|
180
|
+
id: 'Collection_D',
|
181
|
+
collection_type_gid: collection_type.gid,
|
182
|
+
user: user,
|
183
|
+
with_permission_template: true,
|
184
|
+
member_of_collections: [coll_c])
|
185
185
|
end
|
186
186
|
let(:coll_e) do
|
187
|
-
create(:
|
187
|
+
create(:public_collection_lw,
|
188
188
|
id: 'Collection_E',
|
189
189
|
collection_type_gid: collection_type.gid,
|
190
190
|
user: user,
|
191
|
-
|
191
|
+
with_permission_template: true,
|
192
192
|
member_of_collections: [coll_d])
|
193
193
|
end
|
194
194
|
let(:another) do
|
195
|
-
create(:
|
195
|
+
create(:public_collection_lw,
|
196
196
|
id: 'Another_One',
|
197
197
|
collection_type_gid: collection_type.gid,
|
198
198
|
user: user,
|
199
|
-
|
199
|
+
with_permission_template: true)
|
200
200
|
end
|
201
201
|
let(:wrong) do
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
202
|
+
build(:public_collection_lw,
|
203
|
+
id: 'Wrong_Type',
|
204
|
+
collection_type_gid: another_collection_type.gid,
|
205
|
+
user: user,
|
206
|
+
with_permission_template: true)
|
207
207
|
end
|
208
208
|
|
209
209
|
before do
|
@@ -245,18 +245,18 @@ RSpec.describe Hyrax::Collections::NestedCollectionQueryService, clean_repo: tru
|
|
245
245
|
describe 'and are of the same collection type', with_nested_reindexing: true do
|
246
246
|
# using create option here because permission template is required for testing :deposit access
|
247
247
|
let!(:parent) do
|
248
|
-
create(:
|
248
|
+
create(:public_collection_lw,
|
249
249
|
id: 'Parent_Collecton',
|
250
250
|
collection_type_gid: collection_type.gid,
|
251
251
|
user: user,
|
252
|
-
|
252
|
+
with_permission_template: true)
|
253
253
|
end
|
254
254
|
let!(:child) do
|
255
|
-
create(:
|
255
|
+
create(:public_collection_lw,
|
256
256
|
id: 'Child_Collection',
|
257
257
|
collection_type_gid: collection_type.gid,
|
258
258
|
user: user,
|
259
|
-
|
259
|
+
with_permission_template: true)
|
260
260
|
end
|
261
261
|
|
262
262
|
it { is_expected.to eq(true) }
|
@@ -325,8 +325,8 @@ RSpec.describe Hyrax::Collections::NestedCollectionQueryService, clean_repo: tru
|
|
325
325
|
|
326
326
|
describe 'nesting attributes object', with_nested_reindexing: true do
|
327
327
|
let(:user) { create(:user) }
|
328
|
-
let!(:parent) {
|
329
|
-
let!(:child) { create(:
|
328
|
+
let!(:parent) { build(:collection_lw, id: 'Parent_Coll', collection_type_gid: collection_type.gid, user: user) }
|
329
|
+
let!(:child) { create(:user_collection_lw, id: 'Child_Coll', collection_type_gid: collection_type.gid, user: user) }
|
330
330
|
let(:nesting_attributes) { Hyrax::Collections::NestedCollectionQueryService::NestingAttributes.new(id: child.id, scope: scope) }
|
331
331
|
|
332
332
|
before do
|
@@ -8,7 +8,7 @@ RSpec.describe Hyrax::Statistics::Depositors::Summary, :clean_repo do
|
|
8
8
|
let(:end_date) { nil }
|
9
9
|
let!(:work1) { create(:work, user: user1) }
|
10
10
|
let!(:work2) { create(:work, user: user2) }
|
11
|
-
let!(:collection1) { create(:
|
11
|
+
let!(:collection1) { create(:public_collection_lw, user: user1) }
|
12
12
|
let(:service) { described_class.new(start_date, end_date) }
|
13
13
|
|
14
14
|
before do
|
@@ -1,12 +1,19 @@
|
|
1
1
|
RSpec.describe Hyrax::Statistics::Works::ByResourceType do
|
2
2
|
let(:service) { described_class.new }
|
3
|
+
let(:user) { create(:user) }
|
3
4
|
|
4
5
|
describe "#query", :clean_repo do
|
5
6
|
before do
|
6
|
-
|
7
|
-
|
8
|
-
create(:generic_work
|
9
|
-
|
7
|
+
# Creating factories here led to failures found within
|
8
|
+
# https://travis-ci.org/samvera/hyrax/jobs/454752377
|
9
|
+
# One should be able to invoke create(:generic_work)...
|
10
|
+
# ...however, there are difficulties here which relate to the "terms"
|
11
|
+
# requestHandler
|
12
|
+
# @see https://github.com/samvera/hyrax/issues/3491
|
13
|
+
GenericWork.create(title: ['test'], resource_type: ['Conference Proceeding']).save!
|
14
|
+
GenericWork.create(title: ['test'], resource_type: ['Conference Proceeding']).save!
|
15
|
+
GenericWork.create(title: ['test'], resource_type: ['Image']).save!
|
16
|
+
GenericWork.create(title: ['test'], resource_type: ['Journal']).save!
|
10
17
|
end
|
11
18
|
|
12
19
|
subject { service.query }
|
data/spec/spec_helper.rb
CHANGED
@@ -40,6 +40,7 @@ require 'rspec/active_model/mocks'
|
|
40
40
|
require 'capybara/rspec'
|
41
41
|
require 'capybara/rails'
|
42
42
|
require 'selenium-webdriver'
|
43
|
+
require 'chromedriver-helper'
|
43
44
|
require 'equivalent-xml'
|
44
45
|
require 'equivalent-xml/rspec_matchers'
|
45
46
|
require 'database_cleaner'
|
@@ -169,13 +170,6 @@ RSpec.configure do |config|
|
|
169
170
|
DatabaseCleaner.start
|
170
171
|
end
|
171
172
|
|
172
|
-
if example.metadata[:type] == :view
|
173
|
-
# View tests should not hit any services. This ensures the tests are unit
|
174
|
-
# testing only the views and run fast.
|
175
|
-
WebMock.disable_net_connect!(allow_localhost: false)
|
176
|
-
else
|
177
|
-
WebMock.disable_net_connect!(allow_localhost: true)
|
178
|
-
end
|
179
173
|
# using :workflow is preferable to :clean_repo, use the former if possible
|
180
174
|
# It's important that this comes after DatabaseCleaner.start
|
181
175
|
ensure_deposit_available_for(user) if example.metadata[:workflow]
|
@@ -195,7 +189,15 @@ RSpec.configure do |config|
|
|
195
189
|
end
|
196
190
|
|
197
191
|
config.include(ControllerLevelHelpers, type: :view)
|
198
|
-
|
192
|
+
|
193
|
+
config.before(:each, type: :view) do
|
194
|
+
initialize_controller_helpers(view)
|
195
|
+
WebMock.disable_net_connect!(allow_localhost: false)
|
196
|
+
end
|
197
|
+
|
198
|
+
config.after(:each, type: :view) do
|
199
|
+
WebMock.disable_net_connect!(allow_localhost: true)
|
200
|
+
end
|
199
201
|
|
200
202
|
config.before(:all, type: :feature) do
|
201
203
|
# Assets take a long time to compile. This causes two problems:
|
data/spec/support/selectors.rb
CHANGED
@@ -43,7 +43,16 @@ module Selectors
|
|
43
43
|
def select_member_of_collection(collection)
|
44
44
|
find('#s2id_member_of_collection_ids').click
|
45
45
|
find('.select2-input').set(collection.title.first)
|
46
|
-
|
46
|
+
# Crude way of waiting for the AJAX response
|
47
|
+
select2_results = []
|
48
|
+
time_elapsed = 0
|
49
|
+
while select2_results.empty? && time_elapsed < 30
|
50
|
+
begin_time = Time.now.to_f
|
51
|
+
doc = Nokogiri::XML.parse(page.body)
|
52
|
+
select2_results = doc.xpath('//html:li[contains(@class,"select2-result")]', html: 'http://www.w3.org/1999/xhtml')
|
53
|
+
end_time = Time.now.to_f
|
54
|
+
time_elapsed += end_time - begin_time
|
55
|
+
end
|
47
56
|
expect(page).to have_css('.select2-result')
|
48
57
|
within ".select2-result" do
|
49
58
|
find("span", text: collection.title.first).click
|
@@ -1,10 +1,43 @@
|
|
1
1
|
RSpec.describe 'catalog/_thumbnail_list_collection.html.erb', type: :view do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
context "When the collection thumbnail is attached" do
|
3
|
+
let(:attributes) do
|
4
|
+
{ id: "xxx",
|
5
|
+
"has_model_ssim": ["Collection"],
|
6
|
+
"title_tesim": ["Collection Title"],
|
7
|
+
"description_tesim": ["Collection Description"],
|
8
|
+
"system_modified_dtsi": 'date',
|
9
|
+
"thumbnail_path_ss": '/xxx/yyy?file=thumbnail' }
|
10
|
+
end
|
11
|
+
let(:doc) { SolrDocument.new(attributes) }
|
12
|
+
let(:current_ability) { Ability.new(build(:user)) }
|
13
|
+
|
14
|
+
before do
|
15
|
+
render 'catalog/thumbnail_list_collection', document: doc
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'displays the collection thumbnail in the search results' do
|
19
|
+
expect(rendered).to include '/xxx/yyy?file=thumbnail'
|
20
|
+
end
|
5
21
|
end
|
6
22
|
|
7
|
-
|
8
|
-
|
23
|
+
context "When the collection thumbnail is not attached" do
|
24
|
+
let(:attributes) do
|
25
|
+
{ id: "xxx",
|
26
|
+
"has_model_ssim": ["Collection"],
|
27
|
+
"title_tesim": ["Collection Title"],
|
28
|
+
"description_tesim": ["Collection Description"],
|
29
|
+
"system_modified_dtsi": 'date',
|
30
|
+
"thumbnail_path_ss" => Hyrax::CollectionIndexer.thumbnail_path_service.default_image }
|
31
|
+
end
|
32
|
+
let(:doc) { SolrDocument.new(attributes) }
|
33
|
+
let(:current_ability) { Ability.new(build(:user)) }
|
34
|
+
|
35
|
+
before do
|
36
|
+
render 'catalog/thumbnail_list_collection', document: doc
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'displays the collection icon in the search results' do
|
40
|
+
expect(rendered).to include '/assets/collection-'
|
41
|
+
end
|
9
42
|
end
|
10
43
|
end
|
data/template.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyrax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: rails
|
@@ -300,14 +300,14 @@ dependencies:
|
|
300
300
|
requirements:
|
301
301
|
- - ">="
|
302
302
|
- !ruby/object:Gem::Version
|
303
|
-
version: 10.
|
303
|
+
version: 10.6.1
|
304
304
|
type: :runtime
|
305
305
|
prerelease: false
|
306
306
|
version_requirements: !ruby/object:Gem::Requirement
|
307
307
|
requirements:
|
308
308
|
- - ">="
|
309
309
|
- !ruby/object:Gem::Version
|
310
|
-
version: 10.
|
310
|
+
version: 10.6.1
|
311
311
|
- !ruby/object:Gem::Dependency
|
312
312
|
name: hydra-works
|
313
313
|
requirement: !ruby/object:Gem::Requirement
|
@@ -730,6 +730,20 @@ dependencies:
|
|
730
730
|
- - "~>"
|
731
731
|
- !ruby/object:Gem::Version
|
732
732
|
version: 0.3.0
|
733
|
+
- !ruby/object:Gem::Dependency
|
734
|
+
name: chromedriver-helper
|
735
|
+
requirement: !ruby/object:Gem::Requirement
|
736
|
+
requirements:
|
737
|
+
- - "~>"
|
738
|
+
- !ruby/object:Gem::Version
|
739
|
+
version: '2.1'
|
740
|
+
type: :development
|
741
|
+
prerelease: false
|
742
|
+
version_requirements: !ruby/object:Gem::Requirement
|
743
|
+
requirements:
|
744
|
+
- - "~>"
|
745
|
+
- !ruby/object:Gem::Version
|
746
|
+
version: '2.1'
|
733
747
|
- !ruby/object:Gem::Dependency
|
734
748
|
name: database_cleaner
|
735
749
|
requirement: !ruby/object:Gem::Requirement
|
@@ -750,14 +764,14 @@ dependencies:
|
|
750
764
|
requirements:
|
751
765
|
- - "~>"
|
752
766
|
- !ruby/object:Gem::Version
|
753
|
-
version: '2.
|
767
|
+
version: '2.2'
|
754
768
|
type: :development
|
755
769
|
prerelease: false
|
756
770
|
version_requirements: !ruby/object:Gem::Requirement
|
757
771
|
requirements:
|
758
772
|
- - "~>"
|
759
773
|
- !ruby/object:Gem::Version
|
760
|
-
version: '2.
|
774
|
+
version: '2.2'
|
761
775
|
- !ruby/object:Gem::Dependency
|
762
776
|
name: equivalent-xml
|
763
777
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1054,20 +1068,6 @@ dependencies:
|
|
1054
1068
|
- - "<="
|
1055
1069
|
- !ruby/object:Gem::Version
|
1056
1070
|
version: 3.5.0
|
1057
|
-
- !ruby/object:Gem::Dependency
|
1058
|
-
name: chromedriver-helper
|
1059
|
-
requirement: !ruby/object:Gem::Requirement
|
1060
|
-
requirements:
|
1061
|
-
- - "<"
|
1062
|
-
- !ruby/object:Gem::Version
|
1063
|
-
version: '2.0'
|
1064
|
-
type: :development
|
1065
|
-
prerelease: false
|
1066
|
-
version_requirements: !ruby/object:Gem::Requirement
|
1067
|
-
requirements:
|
1068
|
-
- - "<"
|
1069
|
-
- !ruby/object:Gem::Version
|
1070
|
-
version: '2.0'
|
1071
1071
|
description: Hyrax is a featureful Samvera front-end based on the latest and greatest
|
1072
1072
|
Samvera software components.
|
1073
1073
|
email:
|
@@ -2476,6 +2476,7 @@ files:
|
|
2476
2476
|
- spec/factories/workflows.rb
|
2477
2477
|
- spec/factory_tests/adminsets_factory_spec.rb
|
2478
2478
|
- spec/factory_tests/collections_factory_spec.rb
|
2479
|
+
- spec/features/actor_stack_spec.rb
|
2479
2480
|
- spec/features/admin_spec.rb
|
2480
2481
|
- spec/features/batch_create_spec.rb
|
2481
2482
|
- spec/features/batch_edit_spec.rb
|
@@ -3079,7 +3080,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
3079
3080
|
version: '0'
|
3080
3081
|
requirements: []
|
3081
3082
|
rubyforge_project:
|
3082
|
-
rubygems_version: 2.
|
3083
|
+
rubygems_version: 2.7.9
|
3083
3084
|
signing_key:
|
3084
3085
|
specification_version: 4
|
3085
3086
|
summary: Hyrax is a front-end based on the robust Samvera framework, providing a user
|
@@ -3223,6 +3224,7 @@ test_files:
|
|
3223
3224
|
- spec/factories/workflows.rb
|
3224
3225
|
- spec/factory_tests/adminsets_factory_spec.rb
|
3225
3226
|
- spec/factory_tests/collections_factory_spec.rb
|
3227
|
+
- spec/features/actor_stack_spec.rb
|
3226
3228
|
- spec/features/admin_spec.rb
|
3227
3229
|
- spec/features/batch_create_spec.rb
|
3228
3230
|
- spec/features/batch_edit_spec.rb
|