hyrax 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/app/services/hyrax/file_set_derivatives_service.rb +12 -4
  4. data/app/views/hyrax/collections/_collection_description.erb +1 -1
  5. data/hyrax.gemspec +8 -1
  6. data/lib/generators/hyrax/templates/config/hyrax.rb +4 -0
  7. data/lib/hyrax/configuration.rb +6 -0
  8. data/lib/hyrax/version.rb +1 -1
  9. data/spec/abilities/file_set_abilities_spec.rb +3 -3
  10. data/spec/abilities/generic_work_abilities_spec.rb +5 -5
  11. data/spec/actors/hyrax/actors/generic_work_actor_spec.rb +12 -12
  12. data/spec/actors/hyrax/actors/transactional_request_spec.rb +1 -1
  13. data/spec/controllers/hyrax/admin/users_controller_spec.rb +3 -3
  14. data/spec/controllers/hyrax/api/items_controller_spec.rb +6 -6
  15. data/spec/controllers/hyrax/content_blocks_controller_spec.rb +2 -2
  16. data/spec/controllers/hyrax/downloads_controller_spec.rb +3 -3
  17. data/spec/controllers/hyrax/featured_work_lists_controller_spec.rb +2 -2
  18. data/spec/controllers/hyrax/homepage_controller_spec.rb +1 -1
  19. data/spec/controllers/hyrax/tinymce_assets_controller_spec.rb +1 -1
  20. data/spec/controllers/hyrax/users_controller_spec.rb +4 -4
  21. data/spec/controllers/hyrax/workflow_actions_controller_spec.rb +1 -1
  22. data/spec/conversions/power_converters/polymorphic_type_spec.rb +1 -1
  23. data/spec/factories/admin_sets.rb +1 -1
  24. data/spec/factories/api_items.rb +1 -1
  25. data/spec/factories/collections_factory.rb +2 -2
  26. data/spec/factories/content_blocks.rb +1 -1
  27. data/spec/factories/featured_works.rb +1 -1
  28. data/spec/factories/file_sets.rb +3 -3
  29. data/spec/factories/generic_works.rb +15 -15
  30. data/spec/factories/operations.rb +1 -1
  31. data/spec/factories/permission_template_accesses.rb +1 -1
  32. data/spec/factories/permission_templates.rb +1 -1
  33. data/spec/factories/proxy_deposit_requests.rb +2 -2
  34. data/spec/factories/single_use_links.rb +1 -1
  35. data/spec/factories/sipity_entities.rb +1 -1
  36. data/spec/factories/uploaded_files.rb +1 -1
  37. data/spec/factories/users.rb +2 -2
  38. data/spec/factories/workflow_actions.rb +1 -1
  39. data/spec/factories/workflow_states.rb +1 -1
  40. data/spec/factories/workflows.rb +1 -1
  41. data/spec/features/browse_dashboard_files_spec.rb +4 -4
  42. data/spec/features/notifications_spec.rb +1 -1
  43. data/spec/features/show_admin_set_spec.rb +11 -0
  44. data/spec/helpers/hyrax/collections_helper_spec.rb +2 -2
  45. data/spec/helpers/hyrax/content_block_helper_spec.rb +1 -1
  46. data/spec/helpers/hyrax/trophy_helper_spec.rb +1 -1
  47. data/spec/lib/hyrax/arkivo/actor_spec.rb +2 -2
  48. data/spec/lib/hyrax/arkivo/metadata_munger_spec.rb +1 -1
  49. data/spec/lib/hyrax/arkivo/schema_validator_spec.rb +1 -1
  50. data/spec/lib/hyrax/configuration_spec.rb +1 -0
  51. data/spec/models/file_set_spec.rb +1 -1
  52. data/spec/models/generic_work_spec.rb +1 -1
  53. data/spec/models/hyrax/user_usage_stats_spec.rb +1 -1
  54. data/spec/models/sipity/entity_spec.rb +1 -1
  55. data/spec/models/user_spec.rb +7 -7
  56. data/spec/presenters/hyrax/admin/users_presenter_spec.rb +2 -2
  57. data/spec/services/hyrax/embargo_service_spec.rb +4 -4
  58. data/spec/services/hyrax/repository_audit_service_spec.rb +1 -1
  59. data/spec/services/hyrax/workflow/permission_generator_spec.rb +1 -1
  60. data/spec/spec_helper.rb +6 -6
  61. data/spec/support/features/session_helpers.rb +1 -1
  62. data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +1 -1
  63. data/spec/views/hyrax/base/_items.html.erb_spec.rb +2 -2
  64. data/spec/views/hyrax/base/file_manager.html.erb_spec.rb +1 -1
  65. data/spec/views/hyrax/dashboard/index_spec.rb +1 -1
  66. data/template.rb +1 -1
  67. metadata +26 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0379fe162c5ff9207af59dc36af58aead2df14c
4
- data.tar.gz: c5802ec9c6318be8056ff459a39441a80cc12b7c
3
+ metadata.gz: f12bc4422975b30df6990632d50bbd5b39bfa033
4
+ data.tar.gz: 1cbc32cf3989e372d2cff38780af758606fbaec3
5
5
  SHA512:
6
- metadata.gz: cd7d19603b15aa26f5a8500f3f3249e71985e52ce8070b24d9a88d04efad6a239dc9b1d036d80e29c93774dc6839dd3366fdf497dbd6bf544de4f6e7d29e78b0
7
- data.tar.gz: 29e50bbf459b2a8200d0adf473b6334cee516c8f4fb6f6ab6758ea8bdba86f257a7c9bd1cfde14ac323abf64438095331c0d8bde81a184a240c24e441c29e969
6
+ metadata.gz: 74c91fe48c1b7c981ae6c81201d3cbd8732c4efacdfbfb4dcb0652f799a6317efaafcb5171f8dc26a54577cfa834623f9fb2aae01ee62d52fcc41335519a8826
7
+ data.tar.gz: 577a72b3cfe93ba8b47d02da6d418a2dad6066ac9c874c92070a9d4d4beabaaaac5962d1860ecd5b2d60184023a406f859715869bcd8bab0aa158c160642cd3b
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ![Logo](https://raw.githubusercontent.com/samvera/hyrax/gh-pages/assets/images/hyrax_logo_horizontal_white_background.png)
2
2
 
3
3
  Code: [![Version](https://badge.fury.io/rb/hyrax.png)](http://badge.fury.io/rb/hyrax)
4
- [![Build Status](https://travis-ci.org/samvera/hyrax.png?branch=master)](https://travis-ci.org/samvera/hyrax)
4
+ [![Build Status](https://travis-ci.org/samvera/hyrax.png?branch=1-0-stable)](https://travis-ci.org/samvera/hyrax/branches)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/samvera/hyrax/badge.svg?branch=master)](https://coveralls.io/github/samvera/hyrax?branch=master)
6
6
  [![Code Climate](https://codeclimate.com/github/samvera/hyrax/badges/gpa.svg)](https://codeclimate.com/github/samvera/hyrax)
7
7
  [![Dependency Update Status](https://gemnasium.com/samvera/hyrax.png)](https://gemnasium.com/samvera/hyrax)
@@ -59,7 +59,7 @@ If you have questions or need help, please email [the Samvera community tech lis
59
59
  # Getting started
60
60
 
61
61
  This document contains instructions specific to setting up an app with __Hyrax
62
- v1.0.5__. If you are looking for instructions on installing a different
62
+ v1.1.0__. If you are looking for instructions on installing a different
63
63
  version, be sure to select the appropriate branch or tag from the drop-down
64
64
  menu above.
65
65
 
@@ -121,7 +121,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.0 release.
121
121
 
122
122
  ```
123
123
  # If you don't already have Rails at your disposal...
124
- gem install rails -v 5.0.3
124
+ gem install rails -v 5.0.4
125
125
  ```
126
126
 
127
127
  ### JavaScript runtime
@@ -133,7 +133,7 @@ Rails requires that you have a JavaScript runtime -- for example, nodejs -- inst
133
133
  Generate a new Rails application using the template.
134
134
 
135
135
  ```
136
- rails new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v1.0.5/template.rb
136
+ rails new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v1.1.0/template.rb
137
137
  ```
138
138
 
139
139
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -49,8 +49,7 @@ module Hyrax
49
49
  def create_pdf_derivatives(filename)
50
50
  Hydra::Derivatives::PdfDerivatives.create(filename,
51
51
  outputs: [{ label: :thumbnail, format: 'jpg', size: '338x493', url: derivative_url('thumbnail') }])
52
- Hydra::Derivatives::FullTextExtract.create(filename,
53
- outputs: [{ url: uri, container: "extracted_text" }])
52
+ extract_full_text(filename, uri)
54
53
  end
55
54
 
56
55
  def create_office_document_derivatives(filename)
@@ -58,8 +57,7 @@ module Hyrax
58
57
  outputs: [{ label: :thumbnail, format: 'jpg',
59
58
  size: '200x150>',
60
59
  url: derivative_url('thumbnail') }])
61
- Hydra::Derivatives::FullTextExtract.create(filename,
62
- outputs: [{ url: uri, container: "extracted_text" }])
60
+ extract_full_text(filename, uri)
63
61
  end
64
62
 
65
63
  def create_audio_derivatives(filename)
@@ -83,5 +81,15 @@ module Hyrax
83
81
  def derivative_path_factory
84
82
  Hyrax::DerivativePath
85
83
  end
84
+
85
+ # Calls the Hydra::Derivates::FulltextExtraction unless the extract_full_text
86
+ # configuration option is set to false
87
+ # @param [String] filename of the object to be used for full text extraction
88
+ # @param [String] uri to the file set (deligated to file_set)
89
+ def extract_full_text(filename, uri)
90
+ return unless Hyrax.config.extract_full_text?
91
+ Hydra::Derivatives::FullTextExtract.create(filename,
92
+ outputs: [{ url: uri, container: "extracted_text" }])
93
+ end
86
94
  end
87
95
  end
@@ -1,3 +1,3 @@
1
- <% presenter.description.each do |description| %>
1
+ <% presenter.description.try(:each) do |description| %>
2
2
  <p class="collection_description"><%= iconify_auto_link(description) %></p>
3
3
  <% end %>
@@ -80,7 +80,7 @@ EOF
80
80
  spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0'
81
81
  spec.add_development_dependency "capybara", '~> 2.4'
82
82
  spec.add_development_dependency "poltergeist", "~> 1.5"
83
- spec.add_development_dependency "factory_girl_rails", '~> 4.4'
83
+ spec.add_development_dependency "factory_bot_rails", '~> 4.4'
84
84
  spec.add_development_dependency "equivalent-xml", '~> 0.5'
85
85
  spec.add_development_dependency "jasmine", '~> 2.3'
86
86
  spec.add_development_dependency 'rubocop', '~> 0.47.0'
@@ -90,4 +90,11 @@ EOF
90
90
  spec.add_development_dependency 'webmock'
91
91
  spec.add_development_dependency 'i18n-debug' unless ENV['TRAVIS']
92
92
  spec.add_development_dependency 'i18n_yaml_sorter' unless ENV['TRAVIS']
93
+
94
+ ########################################################
95
+ # Temporarily pinned dependencies. INCLUDE EXPLANATIONS.
96
+ #
97
+ # simple_form 3.5.1 broke hydra-editor for certain model types;
98
+ # see: https://github.com/plataformatec/simple_form/issues/1549
99
+ spec.add_dependency 'simple_form', '~> 3.2', '<= 3.5.0'
93
100
  end
@@ -71,6 +71,10 @@ Hyrax.config do |config|
71
71
  # Path to the file derivatives creation tool
72
72
  # config.libreoffice_path = "soffice"
73
73
 
74
+ # Option to enable/disable full text extraction from PDFs
75
+ # Default is true, set to false to disable full text extraction
76
+ # config.extract_full_text = true
77
+
74
78
  # How many seconds back from the current time that we should show by default of the user's activity on the user's dashboard
75
79
  # config.activity_to_show_default_seconds_since_now = 24*60*60
76
80
 
@@ -428,6 +428,12 @@ module Hyrax
428
428
  @subject_prefix ||= "Contact form:"
429
429
  end
430
430
 
431
+ attr_writer :extract_full_text
432
+ def extract_full_text?
433
+ return @extract_full_text unless @extract_full_text.nil?
434
+ @extract_full_text = true
435
+ end
436
+
431
437
  attr_writer :model_to_create
432
438
  # Returns a lambda that takes a hash of attributes and returns a string of the model
433
439
  # name. This is called by the batch upload process
@@ -1,3 +1,3 @@
1
1
  module Hyrax
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -26,7 +26,7 @@ describe 'User' do
26
26
  end
27
27
 
28
28
  describe 'as a repository manager' do
29
- let(:manager_user) { FactoryGirl.create(:admin) }
29
+ let(:manager_user) { FactoryBot.create(:admin) }
30
30
  let(:creating_user) { user }
31
31
  let(:current_user) { manager_user }
32
32
  it do
@@ -39,7 +39,7 @@ describe 'User' do
39
39
  end
40
40
 
41
41
  describe 'another authenticated user' do
42
- let(:creating_user) { FactoryGirl.create(:user) }
42
+ let(:creating_user) { FactoryBot.create(:user) }
43
43
  let(:current_user) { user }
44
44
 
45
45
  it do
@@ -52,7 +52,7 @@ describe 'User' do
52
52
  end
53
53
 
54
54
  describe 'a nil user' do
55
- let(:creating_user) { FactoryGirl.create(:user) }
55
+ let(:creating_user) { FactoryBot.create(:user) }
56
56
  let(:current_user) { nil }
57
57
  it do
58
58
  is_expected.not_to be_able_to(:create, FileSet.new)
@@ -5,8 +5,8 @@ describe 'User' do
5
5
  describe 'Abilities' do
6
6
  subject { Ability.new(current_user) }
7
7
 
8
- let(:generic_work) { FactoryGirl.create(:private_generic_work, user: creating_user) }
9
- let(:user) { FactoryGirl.create(:user) }
8
+ let(:generic_work) { FactoryBot.create(:private_generic_work, user: creating_user) }
9
+ let(:user) { FactoryBot.create(:user) }
10
10
 
11
11
  describe 'without embargo' do
12
12
  describe 'creator of object' do
@@ -21,7 +21,7 @@ describe 'User' do
21
21
  end
22
22
 
23
23
  describe 'as a repository manager' do
24
- let(:manager_user) { FactoryGirl.create(:admin) }
24
+ let(:manager_user) { FactoryBot.create(:admin) }
25
25
  let(:creating_user) { user }
26
26
  let(:current_user) { manager_user }
27
27
  it do
@@ -33,7 +33,7 @@ describe 'User' do
33
33
  end
34
34
 
35
35
  describe 'another authenticated user' do
36
- let(:creating_user) { FactoryGirl.create(:user) }
36
+ let(:creating_user) { FactoryBot.create(:user) }
37
37
  let(:current_user) { user }
38
38
  it do
39
39
  is_expected.to be_able_to(:create, GenericWork.new)
@@ -45,7 +45,7 @@ describe 'User' do
45
45
  end
46
46
 
47
47
  describe 'a nil user' do
48
- let(:creating_user) { FactoryGirl.create(:user) }
48
+ let(:creating_user) { FactoryBot.create(:user) }
49
49
  let(:current_user) { nil }
50
50
  it do
51
51
  is_expected.not_to be_able_to(:create, GenericWork.new)
@@ -85,7 +85,7 @@ describe Hyrax::Actors::GenericWorkActor do
85
85
  context 'with in_work_ids' do
86
86
  let(:parent) { create(:generic_work, user: user) }
87
87
  let(:attributes) do
88
- FactoryGirl.attributes_for(:generic_work, visibility: visibility, admin_set_id: admin_set.id).merge(
88
+ FactoryBot.attributes_for(:generic_work, visibility: visibility, admin_set_id: admin_set.id).merge(
89
89
  in_works_ids: [parent.id]
90
90
  )
91
91
  end
@@ -103,7 +103,7 @@ describe Hyrax::Actors::GenericWorkActor do
103
103
 
104
104
  context 'with a file' do
105
105
  let(:attributes) do
106
- FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
106
+ FactoryBot.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
107
107
  a[:files] = file
108
108
  end
109
109
  end
@@ -138,7 +138,7 @@ describe Hyrax::Actors::GenericWorkActor do
138
138
  context 'with multiple files' do
139
139
  let(:file_actor) { double }
140
140
  let(:attributes) do
141
- FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
141
+ FactoryBot.attributes_for(:generic_work, admin_set_id: admin_set.id, visibility: visibility).tap do |a|
142
142
  a[:files] = [file, file]
143
143
  end
144
144
  end
@@ -168,7 +168,7 @@ describe Hyrax::Actors::GenericWorkActor do
168
168
 
169
169
  context 'with a present and a blank title' do
170
170
  let(:attributes) do
171
- FactoryGirl.attributes_for(:generic_work, admin_set_id: admin_set.id, title: ['this is present', ''])
171
+ FactoryBot.attributes_for(:generic_work, admin_set_id: admin_set.id, title: ['this is present', ''])
172
172
  end
173
173
 
174
174
  it 'stamps each link with the access rights' do
@@ -204,7 +204,7 @@ describe Hyrax::Actors::GenericWorkActor do
204
204
  let(:parent) { create(:generic_work, user: user) }
205
205
  let(:old_parent) { create(:generic_work, user: user) }
206
206
  let(:attributes) do
207
- FactoryGirl.attributes_for(:generic_work).merge(
207
+ FactoryBot.attributes_for(:generic_work).merge(
208
208
  in_works_ids: [parent.id]
209
209
  )
210
210
  end
@@ -219,9 +219,9 @@ describe Hyrax::Actors::GenericWorkActor do
219
219
  end
220
220
  end
221
221
  context 'without in_works_ids' do
222
- let(:old_parent) { FactoryGirl.create(:generic_work) }
222
+ let(:old_parent) { FactoryBot.create(:generic_work) }
223
223
  let(:attributes) do
224
- FactoryGirl.attributes_for(:generic_work).merge(
224
+ FactoryBot.attributes_for(:generic_work).merge(
225
225
  in_works_ids: []
226
226
  )
227
227
  end
@@ -239,9 +239,9 @@ describe Hyrax::Actors::GenericWorkActor do
239
239
  end
240
240
  end
241
241
  context 'with nil in_works_ids' do
242
- let(:parent) { FactoryGirl.create(:generic_work) }
242
+ let(:parent) { FactoryBot.create(:generic_work) }
243
243
  let(:attributes) do
244
- FactoryGirl.attributes_for(:generic_work).merge(
244
+ FactoryBot.attributes_for(:generic_work).merge(
245
245
  in_works_ids: nil
246
246
  )
247
247
  end
@@ -260,7 +260,7 @@ describe Hyrax::Actors::GenericWorkActor do
260
260
  let!(:collection1) { create(:collection, user: user) }
261
261
  let!(:collection2) { create(:collection, user: user) }
262
262
  let(:attributes) do
263
- FactoryGirl.attributes_for(:generic_work, member_of_collection_ids: [collection2.id])
263
+ FactoryBot.attributes_for(:generic_work, member_of_collection_ids: [collection2.id])
264
264
  end
265
265
  before do
266
266
  curation_concern.apply_depositor_metadata(user.user_key)
@@ -288,7 +288,7 @@ describe Hyrax::Actors::GenericWorkActor do
288
288
  let(:file_set2) { create(:file_set) }
289
289
  let(:curation_concern) { create(:generic_work, user: user, ordered_members: [file_set1, file_set2], admin_set_id: admin_set.id) }
290
290
  let(:attributes) do
291
- FactoryGirl.attributes_for(:generic_work, ordered_member_ids: [file_set2.id, file_set1.id])
291
+ FactoryBot.attributes_for(:generic_work, ordered_member_ids: [file_set2.id, file_set1.id])
292
292
  end
293
293
  it 'updates the order of file sets' do
294
294
  expect(curation_concern.ordered_members.to_a).to eq [file_set1, file_set2]
@@ -300,7 +300,7 @@ describe Hyrax::Actors::GenericWorkActor do
300
300
  ## Is this something we want to support?
301
301
  context "when told to stop ordering a file set" do
302
302
  let(:attributes) do
303
- FactoryGirl.attributes_for(:generic_work, ordered_member_ids: [file_set2.id])
303
+ FactoryBot.attributes_for(:generic_work, ordered_member_ids: [file_set2.id])
304
304
  end
305
305
  it "works" do
306
306
  expect(curation_concern.ordered_members.to_a).to eq [file_set1, file_set2]
@@ -12,7 +12,7 @@ RSpec.describe Hyrax::Actors::TransactionalRequest do
12
12
  let(:good_actor) do
13
13
  Class.new(Hyrax::Actors::AbstractActor) do
14
14
  def create(_attributes)
15
- FactoryGirl.create(:user)
15
+ FactoryBot.create(:user)
16
16
  end
17
17
  end
18
18
  end
@@ -1,12 +1,12 @@
1
1
  describe Hyrax::Admin::UsersController, type: :controller do
2
- let!(:user) { FactoryGirl.create(:user) }
2
+ let!(:user) { FactoryBot.create(:user) }
3
3
  before do
4
4
  expect(controller).to receive(:authorize!).with(:read, :admin_dashboard).and_return(true)
5
5
  end
6
- let!(:admin_user) { FactoryGirl.create(:user, groups: 'admin') }
6
+ let!(:admin_user) { FactoryBot.create(:user, groups: 'admin') }
7
7
  let!(:audit_user) { User.audit_user }
8
8
  let!(:batch_user) { User.batch_user }
9
- let!(:guest_user) { FactoryGirl.create(:user, :guest) }
9
+ let!(:guest_user) { FactoryBot.create(:user, :guest) }
10
10
 
11
11
  describe "#index" do
12
12
  it "is successful" do
@@ -20,7 +20,7 @@ describe Hyrax::API::ItemsController, type: :controller do
20
20
 
21
21
  context 'with an HTTP GET or HEAD' do
22
22
  let(:token) { user.arkivo_token }
23
- let(:item) { FactoryGirl.json(:post_item, token: token) }
23
+ let(:item) { FactoryBot.json(:post_item, token: token) }
24
24
  let(:item_hash) { JSON.parse(item) }
25
25
 
26
26
  context 'with a missing token' do
@@ -115,7 +115,7 @@ describe Hyrax::API::ItemsController, type: :controller do
115
115
  let(:deposited_file) { FileSet.where(label: item_hash['file']['filename']).take }
116
116
  let(:a_work) { build :generic_work, id: '123' }
117
117
  let!(:token) { user.arkivo_token }
118
- let(:item) { FactoryGirl.json(:post_item, token: token) }
118
+ let(:item) { FactoryBot.json(:post_item, token: token) }
119
119
  let(:item_hash) { JSON.parse(item) }
120
120
 
121
121
  before do
@@ -157,7 +157,7 @@ describe Hyrax::API::ItemsController, type: :controller do
157
157
  before { post :create, body: item, params: { format: :json } }
158
158
 
159
159
  let(:token) { 'unfamiliar_token' }
160
- let(:item) { FactoryGirl.json(:post_item, token: token) }
160
+ let(:item) { FactoryBot.json(:post_item, token: token) }
161
161
 
162
162
  it "is unathorized" do
163
163
  expect(response).not_to be_success
@@ -168,7 +168,7 @@ describe Hyrax::API::ItemsController, type: :controller do
168
168
  end
169
169
 
170
170
  context 'with an HTTP PUT' do
171
- let(:put_item) { FactoryGirl.json(:put_item, token: token) }
171
+ let(:put_item) { FactoryBot.json(:put_item, token: token) }
172
172
  let(:token) { user.arkivo_token }
173
173
  let(:gw) { build :generic_work, id: '123' }
174
174
  let(:relation) { double }
@@ -261,7 +261,7 @@ describe Hyrax::API::ItemsController, type: :controller do
261
261
 
262
262
  context 'with a valid item and unfamiliar token' do
263
263
  let(:bad_token) { 'unfamiliar_token' }
264
- let(:bad_token_item) { FactoryGirl.json(:put_item, token: bad_token) }
264
+ let(:bad_token_item) { FactoryBot.json(:put_item, token: bad_token) }
265
265
 
266
266
  before do
267
267
  request.env['RAW_POST_DATA'] = bad_token_item
@@ -291,7 +291,7 @@ describe Hyrax::API::ItemsController, type: :controller do
291
291
 
292
292
  context 'with an HTTP DELETE' do
293
293
  let(:token) { user.arkivo_token }
294
- let(:item) { FactoryGirl.json(:post_item, token: token) }
294
+ let(:item) { FactoryBot.json(:post_item, token: token) }
295
295
  let(:item_hash) { JSON.parse(item) }
296
296
  let(:gw) { build :generic_work, id: '123' }
297
297
  let(:relation) { double }
@@ -1,6 +1,6 @@
1
1
  describe Hyrax::ContentBlocksController, type: :controller do
2
2
  describe "#update" do
3
- let(:content_block) { FactoryGirl.create(:content_block) }
3
+ let(:content_block) { FactoryBot.create(:content_block) }
4
4
  before { request.env["HTTP_REFERER"] = "whence_i_came" }
5
5
 
6
6
  context "when not logged in" do
@@ -30,7 +30,7 @@ describe Hyrax::ContentBlocksController, type: :controller do
30
30
  end
31
31
 
32
32
  context "when logged in" do
33
- let(:user) { FactoryGirl.create(:user) }
33
+ let(:user) { FactoryBot.create(:user) }
34
34
  before { allow(controller).to receive_messages(current_user: user) }
35
35
 
36
36
  context "as a user in the admin group" do
@@ -4,9 +4,9 @@ describe Hyrax::DownloadsController do
4
4
  routes { Hyrax::Engine.routes }
5
5
 
6
6
  describe '#show' do
7
- let(:user) { FactoryGirl.create(:user) }
7
+ let(:user) { FactoryBot.create(:user) }
8
8
  let(:file_set) do
9
- FactoryGirl.create(:file_with_work, user: user, content: File.open(fixture_path + '/image.png'))
9
+ FactoryBot.create(:file_with_work, user: user, content: File.open(fixture_path + '/image.png'))
10
10
  end
11
11
  let(:default_image) { ActionController::Base.helpers.image_path 'default.png' }
12
12
  it 'calls render_404 if the object does not exist' do
@@ -15,7 +15,7 @@ describe Hyrax::DownloadsController do
15
15
  end
16
16
 
17
17
  context "when user doesn't have access" do
18
- let(:another_user) { FactoryGirl.create(:user) }
18
+ let(:another_user) { FactoryBot.create(:user) }
19
19
  before { sign_in another_user }
20
20
 
21
21
  it 'redirects to the default image' do
@@ -4,8 +4,8 @@ describe Hyrax::FeaturedWorkListsController, type: :controller do
4
4
  expect(controller).to receive(:authorize!).with(:update, FeaturedWork)
5
5
  end
6
6
 
7
- let(:feature1) { FactoryGirl.create(:featured_work) }
8
- let(:feature2) { FactoryGirl.create(:featured_work) }
7
+ let(:feature1) { FactoryBot.create(:featured_work) }
8
+ let(:feature2) { FactoryBot.create(:featured_work) }
9
9
 
10
10
  it "is successful" do
11
11
  post :create, params: {
@@ -105,7 +105,7 @@ describe Hyrax::HomepageController, type: :controller do
105
105
  end
106
106
 
107
107
  context "with featured works" do
108
- let!(:my_work) { FactoryGirl.create(:work, user: user) }
108
+ let!(:my_work) { FactoryBot.create(:work, user: user) }
109
109
 
110
110
  before do
111
111
  FeaturedWork.create!(work_id: my_work.id)
@@ -2,7 +2,7 @@ describe Hyrax::TinymceAssetsController, type: :controller do
2
2
  let(:file) { fixture_file_upload('/world.png', 'image/png') }
3
3
 
4
4
  context "when logged in" do
5
- let(:user) { FactoryGirl.create(:user) }
5
+ let(:user) { FactoryBot.create(:user) }
6
6
  before { sign_in user }
7
7
 
8
8
  context "as a user who can upload" do
@@ -1,5 +1,5 @@
1
1
  describe Hyrax::UsersController, type: :controller do
2
- let(:user) { FactoryGirl.create(:user) }
2
+ let(:user) { FactoryBot.create(:user) }
3
3
  before do
4
4
  sign_in user
5
5
  allow_any_instance_of(User).to receive(:groups).and_return([])
@@ -86,7 +86,7 @@ describe Hyrax::UsersController, type: :controller do
86
86
  end
87
87
 
88
88
  it "uses the base query" do
89
- u3 = FactoryGirl.create(:user)
89
+ u3 = FactoryBot.create(:user)
90
90
  allow(controller).to receive(:base_query).and_return(["email == \"#{u3.email}\""])
91
91
  get :index
92
92
  expect(assigns[:users]).to include(u3)
@@ -105,7 +105,7 @@ describe Hyrax::UsersController, type: :controller do
105
105
  end
106
106
 
107
107
  context "when user attempts to edit another profile" do
108
- let(:another_user) { FactoryGirl.create(:user) }
108
+ let(:another_user) { FactoryBot.create(:user) }
109
109
  context 'with default abilities' do
110
110
  it "redirects to show profile" do
111
111
  expect_any_instance_of(Ability).to receive(:can?).with(:edit, another_user).and_return(false)
@@ -146,7 +146,7 @@ describe Hyrax::UsersController, type: :controller do
146
146
 
147
147
  describe "#update" do
148
148
  context "the profile of another user" do
149
- let(:another_user) { FactoryGirl.create(:user) }
149
+ let(:another_user) { FactoryBot.create(:user) }
150
150
  it "does not allow other users to update" do
151
151
  post :update, params: { id: another_user.user_key, user: { avatar: nil } }
152
152
  expect(response).to redirect_to(routes.url_helpers.profile_path(another_user.to_param, locale: 'en'))