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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 07d676d225e5f0e4dcf90474785b25b46ba44433088bd4f939b30ac893018907
|
4
|
+
data.tar.gz: '098e92006e2286deb06fe494b56a725051f25076906887842c922706a6502ea2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f2d39f2437e74fa39d13c35e30a931822b61aca590a0fdabd4136df2b5af8ac1a4110398c33cb7f60b5a595dae4cabc55d002d64520625fab99ef2301485dfe
|
7
|
+
data.tar.gz: b2d0d871115bd3c2ba06265f59a47906511b69be05fba5152444bb0e01a9b07ed3df586e622bd91b176b9ee8b805e48a0107e394f178a93db4b69aa9ef7066be
|
data/.circleci/config.yml
CHANGED
@@ -2,100 +2,163 @@
|
|
2
2
|
#
|
3
3
|
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
4
|
#
|
5
|
-
version: 2
|
6
|
-
|
7
|
-
|
5
|
+
version: 2.1
|
6
|
+
executors:
|
7
|
+
ruby:
|
8
8
|
docker:
|
9
|
-
|
10
|
-
|
11
|
-
- image: circleci/redis:4
|
12
|
-
- image: ualbertalib/docker-fcrepo4:4.7
|
13
|
-
environment:
|
14
|
-
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
|
15
|
-
- image: solr:7-alpine
|
16
|
-
command: bin/solr -cloud -noprompt -f -p 8985
|
17
|
-
|
18
|
-
# Specify service dependencies here if necessary
|
19
|
-
# CircleCI maintains a library of pre-built images
|
20
|
-
# documented at https://circleci.com/docs/2.0/circleci-images/
|
21
|
-
# - image: circleci/postgres:9.4
|
22
|
-
|
23
|
-
working_directory: ~/repo
|
24
|
-
parallelism: 2
|
25
|
-
|
9
|
+
- image: circleci/ruby:2.5.3
|
10
|
+
working_directory: ~/hyrax
|
26
11
|
environment:
|
27
|
-
|
28
|
-
RACK_ENV: test
|
29
|
-
FCREPO_TEST_PORT: 8080/fcrepo
|
12
|
+
BUNDLE_PATH: vendor/bundle
|
30
13
|
BUNDLE_JOBS: 4
|
31
14
|
BUNDLE_RETRY: 3
|
32
|
-
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
|
33
|
-
ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
|
34
|
-
SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
|
35
|
-
COVERALLS_PARALLEL: true
|
36
15
|
|
16
|
+
jobs:
|
17
|
+
bundle:
|
18
|
+
executor: ruby
|
37
19
|
steps:
|
38
20
|
- restore_cache:
|
39
21
|
keys:
|
40
|
-
- source-
|
41
|
-
- source-
|
42
|
-
- source-
|
22
|
+
- v1-source-{{ .Branch }}-{{ .Revision }}
|
23
|
+
- v1-source-{{ .Branch }}-
|
24
|
+
- v1-source-
|
43
25
|
|
44
26
|
- checkout
|
45
27
|
|
46
28
|
- save_cache:
|
47
|
-
key: source-
|
29
|
+
key: v1-source-{{ .Branch }}-{{ .Revision }}
|
48
30
|
paths:
|
49
31
|
- ".git"
|
50
32
|
|
51
|
-
# BUNDLE_PATH is unset to allow for `bundle config path` to take precedence.
|
52
|
-
- run:
|
53
|
-
name: Extra environment setup
|
54
|
-
command: |
|
55
|
-
echo 'unset BUNDLE_PATH' >> $BASH_ENV
|
56
|
-
|
57
|
-
- restore_cache:
|
58
|
-
keys:
|
59
|
-
- v1-internal-test-app-{{ .Branch }}
|
60
|
-
- v1-internal-test-app-
|
61
|
-
|
62
|
-
# Download and cache dependencies
|
63
33
|
- restore_cache:
|
64
34
|
keys:
|
65
|
-
- v1-
|
66
|
-
- v1-
|
67
|
-
- v1-dependencies-
|
35
|
+
- v1-bundle-{{ checksum "Gemfile" }}--{{ checksum "hyrax.gemspec" }}
|
36
|
+
- v1-bundle
|
68
37
|
|
69
38
|
- run:
|
70
39
|
name: Install dependencies
|
71
|
-
command:
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
40
|
+
command: bundle check || bundle install
|
41
|
+
|
42
|
+
- save_cache:
|
43
|
+
key: v1-bundle-{{ checksum "Gemfile.lock" }}--{{ checksum "hyrax.gemspec" }}
|
44
|
+
paths:
|
45
|
+
- ~/hyrax/vendor/bundle
|
46
|
+
|
47
|
+
- persist_to_workspace:
|
48
|
+
root: ~/
|
49
|
+
paths:
|
50
|
+
- hyrax/*
|
51
|
+
- hyrax/**/*
|
52
|
+
|
53
|
+
lint:
|
54
|
+
executor: ruby
|
55
|
+
steps:
|
56
|
+
- attach_workspace:
|
57
|
+
at: ~/
|
76
58
|
|
77
59
|
- run:
|
78
60
|
name: Call Rubocop
|
79
61
|
command: bundle exec rubocop
|
80
62
|
|
63
|
+
build:
|
64
|
+
docker:
|
65
|
+
- image: circleci/ruby:2.5.3-node
|
66
|
+
|
67
|
+
working_directory: ~/hyrax
|
68
|
+
|
69
|
+
environment:
|
70
|
+
BUNDLE_PATH: vendor/bundle
|
71
|
+
BUNDLE_JOBS: 4
|
72
|
+
BUNDLE_RETRY: 3
|
73
|
+
RAILS_ENV: test
|
74
|
+
RACK_ENV: test
|
75
|
+
FCREPO_TEST_PORT: 8080/fcrepo
|
76
|
+
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
|
77
|
+
ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
|
78
|
+
SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
|
79
|
+
COVERALLS_PARALLEL: true
|
80
|
+
|
81
|
+
steps:
|
82
|
+
- attach_workspace:
|
83
|
+
at: ~/
|
84
|
+
|
85
|
+
# Update to the latest release of Chrome
|
86
|
+
- run: wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
87
|
+
- run: sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
88
|
+
- run: sudo apt-get update && sudo apt-get -y install google-chrome-stable
|
89
|
+
|
90
|
+
- restore_cache:
|
91
|
+
keys:
|
92
|
+
- v1-test-app-{{ checksum "template.rb" }}--{{ checksum "Gemfile.lock" }}
|
93
|
+
|
94
|
+
- run:
|
95
|
+
name: Check dependencies
|
96
|
+
command: bundle check || bundle install
|
97
|
+
|
98
|
+
- run:
|
99
|
+
name: Generate test app
|
100
|
+
command: (git diff --name-only master | grep -qG 'generators\/hyrax') || bundle exec rake engine_cart:generate
|
101
|
+
|
81
102
|
- run:
|
82
|
-
name:
|
103
|
+
name: Ensure test app dependencies are installed
|
83
104
|
command: |
|
84
|
-
|
85
|
-
bundle install
|
105
|
+
cd .internal_test_app
|
106
|
+
bundle check || bundle install
|
86
107
|
|
87
108
|
- save_cache:
|
109
|
+
key: v1-test-app-{{ checksum "template.rb" }}--{{ checksum "Gemfile.lock" }}
|
88
110
|
paths:
|
89
|
-
-
|
90
|
-
|
111
|
+
- ".internal_test_app"
|
112
|
+
|
113
|
+
- persist_to_workspace:
|
114
|
+
root: ~/
|
115
|
+
paths:
|
116
|
+
- hyrax/*
|
117
|
+
- hyrax/**/*
|
118
|
+
|
119
|
+
test:
|
120
|
+
docker:
|
121
|
+
- image: circleci/ruby:2.5.3-node-browsers-legacy
|
122
|
+
- image: circleci/redis:4
|
123
|
+
- image: ualbertalib/docker-fcrepo4:4.7
|
124
|
+
environment:
|
125
|
+
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
|
126
|
+
- image: solr:7-alpine
|
127
|
+
command: bin/solr -cloud -noprompt -f -p 8985
|
128
|
+
|
129
|
+
working_directory: ~/hyrax
|
130
|
+
parallelism: 4
|
131
|
+
|
132
|
+
environment:
|
133
|
+
BUNDLE_PATH: vendor/bundle
|
134
|
+
BUNDLE_JOBS: 4
|
135
|
+
BUNDLE_RETRY: 3
|
136
|
+
RAILS_ENV: test
|
137
|
+
RACK_ENV: test
|
138
|
+
FCREPO_TEST_PORT: 8080/fcrepo
|
139
|
+
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
|
140
|
+
ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
|
141
|
+
SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
|
142
|
+
COVERALLS_PARALLEL: true
|
143
|
+
|
144
|
+
steps:
|
145
|
+
- attach_workspace:
|
146
|
+
at: ~/
|
147
|
+
|
148
|
+
- run:
|
149
|
+
name: Ensure top-level Gemfile.lock is valid
|
150
|
+
command: bundle check || bundle install
|
91
151
|
|
92
152
|
- run:
|
93
|
-
name:
|
94
|
-
command:
|
95
|
-
background: true
|
153
|
+
name: Uninstall chromedriver Gems
|
154
|
+
command: gem uninstall -ax chromedriver-helper
|
96
155
|
|
97
156
|
- run:
|
98
|
-
name:
|
157
|
+
name: Install chromedriver Gems
|
158
|
+
command: gem install chromedriver-helper
|
159
|
+
|
160
|
+
- run:
|
161
|
+
name: Load config into solr
|
99
162
|
command: |
|
100
163
|
cd .internal_test_app/solr/config
|
101
164
|
zip -1 -r solr_hyrax_config.zip ./*
|
@@ -108,18 +171,25 @@ jobs:
|
|
108
171
|
mkdir /tmp/test-results
|
109
172
|
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
110
173
|
|
111
|
-
- run:
|
112
|
-
name: Clean dependencies
|
113
|
-
command: bundle clean
|
114
|
-
|
115
|
-
- save_cache:
|
116
|
-
paths:
|
117
|
-
- ./vendor/bundle
|
118
|
-
key: v1-dependencies-{{ .Branch }}-{{ checksum "./.internal_test_app/.generated_engine_cart" }}
|
119
|
-
|
120
174
|
# collect reports
|
121
175
|
- store_test_results:
|
122
176
|
path: /tmp/test-results
|
123
177
|
- store_artifacts:
|
124
178
|
path: /tmp/test-results
|
125
179
|
destination: test-results
|
180
|
+
|
181
|
+
workflows:
|
182
|
+
version: 2
|
183
|
+
ci:
|
184
|
+
jobs:
|
185
|
+
- bundle
|
186
|
+
- lint:
|
187
|
+
requires:
|
188
|
+
- bundle
|
189
|
+
- build:
|
190
|
+
requires:
|
191
|
+
- bundle
|
192
|
+
- test:
|
193
|
+
requires:
|
194
|
+
- build
|
195
|
+
- lint
|
data/.travis.yml
CHANGED
@@ -3,7 +3,9 @@ sudo: required
|
|
3
3
|
dist: trusty
|
4
4
|
|
5
5
|
addons:
|
6
|
-
|
6
|
+
apt:
|
7
|
+
packages:
|
8
|
+
- chromium-chromedriver
|
7
9
|
cache:
|
8
10
|
bundler: true
|
9
11
|
|
@@ -31,3 +33,4 @@ services:
|
|
31
33
|
- redis-server
|
32
34
|
before_script:
|
33
35
|
- jdk_switcher use oraclejdk8
|
36
|
+
- ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver
|
data/README.md
CHANGED
@@ -64,7 +64,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
|
|
64
64
|
# Getting started
|
65
65
|
|
66
66
|
This document contains instructions specific to setting up an app with __Hyrax
|
67
|
-
v2.
|
67
|
+
v2.5.0__. If you are looking for instructions on installing a different
|
68
68
|
version, be sure to select the appropriate branch or tag from the drop-down
|
69
69
|
menu above.
|
70
70
|
|
@@ -163,7 +163,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
|
|
163
163
|
Generate a new Rails application using the template.
|
164
164
|
|
165
165
|
```
|
166
|
-
rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.
|
166
|
+
rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.5.0/template.rb
|
167
167
|
```
|
168
168
|
|
169
169
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
@@ -1,24 +1,24 @@
|
|
1
1
|
module Hyrax
|
2
2
|
module Actors
|
3
|
-
#
|
4
|
-
# This
|
3
|
+
# Used to wrap the stack in a database transaction.
|
4
|
+
# This would have rolled back any database actions (particularly workflow) if there
|
5
5
|
# is an error elsewhere in the actor stack.
|
6
|
+
# This was problematic, is removed in v3.0, and is currently a no-op
|
7
|
+
# Backport of https://github.com/samvera/hyrax/pull/3482
|
6
8
|
class TransactionalRequest < Actors::AbstractActor
|
9
|
+
# rubocop:disable Rails/Delegate
|
7
10
|
# @param [Hyrax::Actors::Environment] env
|
8
11
|
# @return [Boolean] true if create was successful
|
9
12
|
def create(env)
|
10
|
-
|
11
|
-
next_actor.create(env)
|
12
|
-
end
|
13
|
+
next_actor.create(env)
|
13
14
|
end
|
14
15
|
|
15
16
|
# @param [Hyrax::Actors::Environment] env
|
16
17
|
# @return [Boolean] true if update was successful
|
17
18
|
def update(env)
|
18
|
-
|
19
|
-
next_actor.update(env)
|
20
|
-
end
|
19
|
+
next_actor.update(env)
|
21
20
|
end
|
21
|
+
# rubocop:enable Rails/Delegate
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -3,8 +3,10 @@ module Hyrax
|
|
3
3
|
# rubocop:disable Metrics/MethodLength
|
4
4
|
def self.build_stack
|
5
5
|
ActionDispatch::MiddlewareStack.new.tap do |middleware|
|
6
|
-
#
|
7
|
-
#
|
6
|
+
# Used to wrap everything in a database transaction, if the save of the resource
|
7
|
+
# failed then rolled back any database AdminSetChangeSet
|
8
|
+
# This was problematic, is removed in v3.0, and is currently a no-op
|
9
|
+
# Backport of https://github.com/samvera/hyrax/pull/3482
|
8
10
|
middleware.use Hyrax::Actors::TransactionalRequest
|
9
11
|
|
10
12
|
# Ensure you are mutating the most recent version
|
data/hyrax.gemspec
CHANGED
@@ -51,7 +51,7 @@ SUMMARY
|
|
51
51
|
spec.add_dependency 'font-awesome-rails', '~> 4.2'
|
52
52
|
spec.add_dependency 'hydra-derivatives', '~> 3.3'
|
53
53
|
spec.add_dependency 'hydra-editor', '>= 3.3', '< 5.0'
|
54
|
-
spec.add_dependency 'hydra-head', '>= 10.
|
54
|
+
spec.add_dependency 'hydra-head', '>= 10.6.1'
|
55
55
|
spec.add_dependency 'hydra-works', '>= 0.16', '< 2.0'
|
56
56
|
spec.add_dependency 'iiif_manifest', '>= 0.3', '< 0.6'
|
57
57
|
spec.add_dependency 'jquery-datatables-rails', '~> 3.4'
|
@@ -83,8 +83,9 @@ SUMMARY
|
|
83
83
|
# temporary pin to 2.17 due to failures caused in 2.18.0
|
84
84
|
spec.add_development_dependency "capybara", '~> 2.4', '< 2.18.0'
|
85
85
|
spec.add_development_dependency 'capybara-maleficent', '~> 0.3.0'
|
86
|
+
spec.add_development_dependency 'chromedriver-helper', '~> 2.1'
|
86
87
|
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
87
|
-
spec.add_development_dependency 'engine_cart', '~> 2.
|
88
|
+
spec.add_development_dependency 'engine_cart', '~> 2.2'
|
88
89
|
spec.add_development_dependency "equivalent-xml", '~> 0.5'
|
89
90
|
spec.add_development_dependency "factory_bot", '~> 4.4'
|
90
91
|
spec.add_development_dependency 'fcrepo_wrapper', '~> 0.5', '>= 0.5.1'
|
@@ -112,8 +113,4 @@ SUMMARY
|
|
112
113
|
# simple_form 3.5.1 broke hydra-editor for certain model types;
|
113
114
|
# see: https://github.com/plataformatec/simple_form/issues/1549
|
114
115
|
spec.add_dependency 'simple_form', '~> 3.2', '<= 3.5.0'
|
115
|
-
# chromedriver-helper 2.0 broke the chromedriver used by capybara
|
116
|
-
# see: https://github.com/flavorjones/chromedriver-helper/issues/62
|
117
|
-
# and https://github.com/flavorjones/chromedriver-helper/issues/57
|
118
|
-
spec.add_development_dependency 'chromedriver-helper', '< 2.0'
|
119
116
|
end
|
data/lib/hyrax/version.rb
CHANGED
@@ -10,7 +10,7 @@ RSpec.describe 'CollectionAbility' do
|
|
10
10
|
|
11
11
|
context 'when admin user' do
|
12
12
|
let(:user) { FactoryBot.create(:admin) }
|
13
|
-
let!(:collection) {
|
13
|
+
let!(:collection) { build(:collection_lw, id: 'col_au', with_permission_template: true, collection_type_gid: collection_type_gid) }
|
14
14
|
let!(:solr_document) { SolrDocument.new(collection.to_solr) }
|
15
15
|
|
16
16
|
it 'allows all abilities' do # rubocop:disable RSpec/ExampleLength
|
@@ -34,7 +34,7 @@ RSpec.describe 'CollectionAbility' do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'when collection manager' do
|
37
|
-
let!(:collection) {
|
37
|
+
let!(:collection) { build(:collection_lw, id: 'col_mu', with_permission_template: true, collection_type_gid: collection_type_gid) }
|
38
38
|
let!(:solr_document) { SolrDocument.new(collection.to_solr) }
|
39
39
|
|
40
40
|
before do
|
@@ -69,7 +69,7 @@ RSpec.describe 'CollectionAbility' do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
context 'when collection depositor' do
|
72
|
-
let!(:collection) {
|
72
|
+
let!(:collection) { build(:collection_lw, id: 'col_du', with_permission_template: true, collection_type_gid: collection_type_gid) }
|
73
73
|
let!(:solr_document) { SolrDocument.new(collection.to_solr) }
|
74
74
|
|
75
75
|
before do
|
@@ -104,7 +104,7 @@ RSpec.describe 'CollectionAbility' do
|
|
104
104
|
end
|
105
105
|
|
106
106
|
context 'when collection viewer' do
|
107
|
-
let!(:collection) {
|
107
|
+
let!(:collection) { build(:collection_lw, id: 'col_vu', with_permission_template: true, collection_type_gid: collection_type_gid) }
|
108
108
|
let!(:solr_document) { SolrDocument.new(collection.to_solr) }
|
109
109
|
|
110
110
|
before do
|
@@ -139,7 +139,7 @@ RSpec.describe 'CollectionAbility' do
|
|
139
139
|
end
|
140
140
|
|
141
141
|
context 'when user has no special access' do
|
142
|
-
let!(:collection) { create(:
|
142
|
+
let!(:collection) { create(:collection_lw, id: 'as', with_permission_template: true, collection_type_gid: collection_type_gid) }
|
143
143
|
let!(:solr_document) { SolrDocument.new(collection.to_solr) }
|
144
144
|
|
145
145
|
it 'denies all abilities' do # rubocop:disable RSpec/ExampleLength
|
@@ -8,7 +8,7 @@ RSpec.describe 'PermissionTemplateAbility' do
|
|
8
8
|
let(:current_user) { user }
|
9
9
|
let(:collection_type_gid) { create(:collection_type).gid }
|
10
10
|
|
11
|
-
let!(:collection) { create(:
|
11
|
+
let!(:collection) { create(:collection_lw, with_permission_template: true, collection_type_gid: collection_type_gid) }
|
12
12
|
let(:permission_template) { collection.permission_template }
|
13
13
|
let!(:permission_template_access) do
|
14
14
|
create(:permission_template_access,
|