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
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Hyrax::WorkflowActionsController, type: :controller do
4
- let(:user) { FactoryGirl.create(:user) }
4
+ let(:user) { FactoryBot.create(:user) }
5
5
  let(:generic_work) { GenericWork.new(id: '123') }
6
6
  let(:form) { instance_double(Hyrax::Forms::WorkflowActionForm) }
7
7
  routes { Rails.application.routes }
@@ -7,7 +7,7 @@ RSpec.describe 'PowerConverter', no_clean: true do
7
7
  expect(PowerConverter.convert_to_polymorphic_type(object)).to eq(:symbol)
8
8
  end
9
9
  it 'will convert an ActiveRecord::Base object' do
10
- user = FactoryGirl.build(:user)
10
+ user = FactoryBot.build(:user)
11
11
  expect(PowerConverter.convert_to_polymorphic_type(user)).to eq(user.class)
12
12
  end
13
13
  it 'will convert an object that responds to #base_class' do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :admin_set do
3
3
  sequence(:title) { |n| ["Title #{n}"] }
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :post_item, class: Hash do
3
3
  skip_create
4
4
 
@@ -1,7 +1,7 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :collection do
3
3
  transient do
4
- user { FactoryGirl.create(:user) }
4
+ user { FactoryBot.create(:user) }
5
5
  end
6
6
  sequence(:title) { |n| ["Title #{n}"] }
7
7
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :content_block do |_cb|
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :featured_work do |_u|
3
3
  end
4
4
  end
@@ -1,7 +1,7 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :file_set do
3
3
  transient do
4
- user { FactoryGirl.create(:user) }
4
+ user { FactoryBot.create(:user) }
5
5
  content nil
6
6
  end
7
7
  after(:build) do |fs, evaluator|
@@ -63,7 +63,7 @@ FactoryGirl.define do
63
63
  if evaluator.content
64
64
  Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
65
65
  end
66
- FactoryGirl.create(:generic_work, user: evaluator.user).members << file
66
+ FactoryBot.create(:generic_work, user: evaluator.user).members << file
67
67
  end
68
68
  end
69
69
  end
@@ -1,7 +1,7 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :work, aliases: [:generic_work, :private_generic_work], class: GenericWork do
3
3
  transient do
4
- user { FactoryGirl.create(:user) }
4
+ user { FactoryBot.create(:user) }
5
5
  # Set to true (or a hash) if you want to create an admin set
6
6
  with_admin_set false
7
7
  end
@@ -37,45 +37,45 @@ FactoryGirl.define do
37
37
 
38
38
  factory :work_with_one_file do
39
39
  before(:create) do |work, evaluator|
40
- work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user, title: ['A Contained FileSet'], label: 'filename.pdf')
40
+ work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user, title: ['A Contained FileSet'], label: 'filename.pdf')
41
41
  end
42
42
  end
43
43
 
44
44
  factory :work_with_files do
45
- before(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user) } }
45
+ before(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user) } }
46
46
  end
47
47
 
48
48
  factory :work_with_ordered_files do
49
49
  before(:create) do |work, evaluator|
50
- work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user)
51
- work.ordered_member_proxies.insert_target_at(0, FactoryGirl.create(:file_set, user: evaluator.user))
50
+ work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user)
51
+ work.ordered_member_proxies.insert_target_at(0, FactoryBot.create(:file_set, user: evaluator.user))
52
52
  end
53
53
  end
54
54
 
55
55
  factory :work_with_one_child do
56
56
  before(:create) do |work, evaluator|
57
- work.ordered_members << FactoryGirl.create(:generic_work, user: evaluator.user, title: ['A Contained Work'])
57
+ work.ordered_members << FactoryBot.create(:generic_work, user: evaluator.user, title: ['A Contained Work'])
58
58
  end
59
59
  end
60
60
 
61
61
  factory :work_with_two_children do
62
62
  before(:create) do |work, evaluator|
63
- work.ordered_members << FactoryGirl.create(:generic_work, user: evaluator.user, title: ['A Contained Work'], id: "BlahBlah1")
64
- work.ordered_members << FactoryGirl.create(:generic_work, user: evaluator.user, title: ['Another Contained Work'], id: "BlahBlah2")
63
+ work.ordered_members << FactoryBot.create(:generic_work, user: evaluator.user, title: ['A Contained Work'], id: "BlahBlah1")
64
+ work.ordered_members << FactoryBot.create(:generic_work, user: evaluator.user, title: ['Another Contained Work'], id: "BlahBlah2")
65
65
  end
66
66
  end
67
67
 
68
68
  factory :work_with_representative_file do
69
69
  before(:create) do |work, evaluator|
70
- work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user, title: ['A Contained FileSet'])
70
+ work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user, title: ['A Contained FileSet'])
71
71
  work.representative_id = work.members[0].id
72
72
  end
73
73
  end
74
74
 
75
75
  factory :work_with_file_and_work do
76
76
  before(:create) do |work, evaluator|
77
- work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user)
78
- work.ordered_members << FactoryGirl.create(:generic_work, user: evaluator.user)
77
+ work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user)
78
+ work.ordered_members << FactoryBot.create(:generic_work, user: evaluator.user)
79
79
  end
80
80
  end
81
81
 
@@ -90,7 +90,7 @@ FactoryGirl.define do
90
90
  end
91
91
  factory :embargoed_work_with_files do
92
92
  after(:build) { |work, evaluator| work.apply_embargo(evaluator.embargo_date, evaluator.current_state, evaluator.future_state) }
93
- after(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user) } }
93
+ after(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user) } }
94
94
  end
95
95
  end
96
96
 
@@ -105,7 +105,7 @@ FactoryGirl.define do
105
105
  end
106
106
  factory :leased_work_with_files do
107
107
  after(:build) { |work, evaluator| work.apply_lease(evaluator.lease_date, evaluator.current_state, evaluator.future_state) }
108
- after(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryGirl.create(:file_set, user: evaluator.user) } }
108
+ after(:create) { |work, evaluator| 2.times { work.ordered_members << FactoryBot.create(:file_set, user: evaluator.user) } }
109
109
  end
110
110
  end
111
111
  end
@@ -113,6 +113,6 @@ FactoryGirl.define do
113
113
  # Doesn't set up any edit_users
114
114
  factory :work_without_access, class: GenericWork do
115
115
  title ['Test title']
116
- depositor { FactoryGirl.create(:user).user_key }
116
+ depositor { FactoryBot.create(:user).user_key }
117
117
  end
118
118
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :operation, class: Hyrax::Operation do
3
3
  operation_type "Test operation"
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :permission_template_access, class: Hyrax::PermissionTemplateAccess do
3
3
  permission_template
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :permission_template, class: Hyrax::PermissionTemplate do
3
3
  # Given that there is a one to one strong relation between permission_template and admin_set,
4
4
  # with a unique index on the admin_set_id, I don't want to have duplication in admin_set_id
@@ -1,6 +1,6 @@
1
- # Read about factories at https://github.com/thoughtbot/factory_girl
1
+ # Read about factories at https://github.com/thoughtbot/factory_bot
2
2
 
3
- FactoryGirl.define do
3
+ FactoryBot.define do
4
4
  factory :proxy_deposit_request do
5
5
  end
6
6
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :single_use_link do
3
3
  factory :show_link do
4
4
  itemId 'fs-id'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :sipity_entity, class: Sipity::Entity do
3
3
  proxy_for_global_id 'gid://internal/Mock/1'
4
4
  workflow { workflow_state.workflow }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :uploaded_file, class: Hyrax::UploadedFile do
3
3
  user
4
4
  end
@@ -1,11 +1,11 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user do
3
3
  sequence(:email) { |n| "user#{n}@example.com" }
4
4
  password 'password'
5
5
 
6
6
  transient do
7
7
  # Allow for custom groups when a user is instantiated.
8
- # @example FactoryGirl.create(:user, groups: 'avacado')
8
+ # @example FactoryBot.create(:user, groups: 'avacado')
9
9
  groups []
10
10
  end
11
11
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :workflow_action, class: Sipity::WorkflowAction do
3
3
  workflow
4
4
  name 'submit'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :workflow_state, class: Sipity::WorkflowState do
3
3
  workflow
4
4
  name 'initial'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :workflow, class: Sipity::Workflow do
3
3
  sequence(:name) { |n| "generic_work-#{n}" }
4
4
  permission_template
@@ -1,8 +1,8 @@
1
1
  describe "Browse Dashboard", type: :feature do
2
- let(:user) { FactoryGirl.create(:user) }
3
- let!(:dissertation) { FactoryGirl.create(:public_work, user: user, title: ["Fake PDF Title"], subject: %w(lorem ipsum dolor sit amet)) }
4
- let!(:mp3_work) { FactoryGirl.create(:public_work, user: user, title: ["Test Document MP3"], subject: %w(consectetur adipisicing elit)) }
5
- let!(:audio_work) { FactoryGirl.create(:public_work, user: user, title: ["Fake Wav Files"], subject: %w(sed do eiusmod tempor incididunt ut labore)) }
2
+ let(:user) { FactoryBot.create(:user) }
3
+ let!(:dissertation) { FactoryBot.create(:public_work, user: user, title: ["Fake PDF Title"], subject: %w(lorem ipsum dolor sit amet)) }
4
+ let!(:mp3_work) { FactoryBot.create(:public_work, user: user, title: ["Test Document MP3"], subject: %w(consectetur adipisicing elit)) }
5
+ let!(:audio_work) { FactoryBot.create(:public_work, user: user, title: ["Fake Wav Files"], subject: %w(sed do eiusmod tempor incididunt ut labore)) }
6
6
 
7
7
  before do
8
8
  sign_in user
@@ -1,6 +1,6 @@
1
1
  describe "Notifications page", type: :feature do
2
2
  before do
3
- sign_in FactoryGirl.create(:user_with_mail)
3
+ sign_in FactoryBot.create(:user_with_mail)
4
4
  visit "/notifications"
5
5
  end
6
6
 
@@ -0,0 +1,11 @@
1
+ RSpec.feature 'show admin set' do
2
+ let(:admin_set) { FactoryBot.create(:admin_set) }
3
+ let(:admin) { FactoryBot.create(:admin) }
4
+
5
+ scenario "show admin set" do
6
+ login_as admin
7
+ expect(admin_set.description).to be_empty
8
+ visit("/admin/admin_sets/#{admin_set.id}")
9
+ expect(page).to have_content admin_set.title.first
10
+ end
11
+ end
@@ -54,7 +54,7 @@ describe Hyrax::CollectionsHelper do
54
54
 
55
55
  describe "button_for_remove_from_collection" do
56
56
  let(:item) { double(id: 'changeme:123') }
57
- let(:collection) { FactoryGirl.create(:collection) }
57
+ let(:collection) { FactoryBot.create(:collection) }
58
58
 
59
59
  it "generates a form that can remove the item" do
60
60
  str = button_for_remove_from_collection collection, item
@@ -91,7 +91,7 @@ describe Hyrax::CollectionsHelper do
91
91
  end
92
92
 
93
93
  describe "button_for_remove_selected_from_collection" do
94
- let(:collection) { FactoryGirl.create(:collection) }
94
+ let(:collection) { FactoryBot.create(:collection) }
95
95
 
96
96
  it "creates a button to the collections delete path" do
97
97
  str = button_for_remove_selected_from_collection collection
@@ -1,5 +1,5 @@
1
1
  describe Hyrax::ContentBlockHelper, type: :helper do
2
- let(:content_block) { FactoryGirl.create(:content_block, value: "<p>foo bar</p>") }
2
+ let(:content_block) { FactoryBot.create(:content_block, value: "<p>foo bar</p>") }
3
3
 
4
4
  subject { helper.editable_content_block(content_block) }
5
5
 
@@ -1,6 +1,6 @@
1
1
  describe Hyrax::TrophyHelper, type: :helper do
2
2
  describe "#display_trophy_link" do
3
- let(:user) { FactoryGirl.create(:user) }
3
+ let(:user) { FactoryBot.create(:user) }
4
4
  let(:id) { '9999' }
5
5
 
6
6
  let(:text_attributes) { '[data-add-text="Highlight Work on Profile"][data-remove-text="Unhighlight Work"]' }
@@ -11,7 +11,7 @@ describe Hyrax::Arkivo::Actor do
11
11
  subject { described_class.new(user, item) }
12
12
 
13
13
  let(:user) { create(:user) }
14
- let(:item) { JSON.parse(FactoryGirl.json(:post_item)) }
14
+ let(:item) { JSON.parse(FactoryBot.json(:post_item)) }
15
15
 
16
16
  describe 'Tempfile monkey-patches' do
17
17
  subject { Tempfile.new('foo') }
@@ -43,7 +43,7 @@ describe Hyrax::Arkivo::Actor do
43
43
  end
44
44
 
45
45
  describe '#update_work_from_item' do
46
- let(:item) { JSON.parse(FactoryGirl.json(:put_item)) }
46
+ let(:item) { JSON.parse(FactoryBot.json(:put_item)) }
47
47
  let(:title) { ['ZZZZZ'] }
48
48
  let(:description) { ['This is rather lengthy.'] }
49
49
  let(:checksum) { 'abc123' }
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Hyrax::Arkivo::MetadataMunger do
4
4
  subject { described_class.new(metadata) }
5
5
 
6
- let(:metadata) { JSON.parse(FactoryGirl.json(:post_item))['metadata'] }
6
+ let(:metadata) { JSON.parse(FactoryBot.json(:post_item))['metadata'] }
7
7
 
8
8
  it 'makes camelCase symbols into underscored strings' do
9
9
  expect(metadata).to include('resourceType', 'dateCreated', 'basedNear')
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Hyrax::Arkivo::SchemaValidator do
4
- let(:item) { JSON.parse(FactoryGirl.json(:post_item)) }
4
+ let(:item) { JSON.parse(FactoryBot.json(:post_item)) }
5
5
 
6
6
  it 'ensures a token is included' do
7
7
  expect do
@@ -53,6 +53,7 @@ describe Hyrax::Configuration do
53
53
  it { is_expected.to respond_to(:translate_uri_to_id) }
54
54
  it { is_expected.to respond_to(:upload_path) }
55
55
  it { is_expected.to respond_to(:work_requires_files?) }
56
+ it { is_expected.to respond_to(:extract_full_text?) }
56
57
  it { is_expected.to respond_to(:whitelisted_ingest_dirs) }
57
58
  it { is_expected.to respond_to(:whitelisted_ingest_dirs=) }
58
59
  end
@@ -211,7 +211,7 @@ describe FileSet do
211
211
  end
212
212
 
213
213
  context 'when there are related files' do
214
- let(:parent_work) { FactoryGirl.create(:work_with_files) }
214
+ let(:parent_work) { FactoryBot.create(:work_with_files) }
215
215
  let(:f1) { parent_work.file_sets.first }
216
216
  let(:f2) { parent_work.file_sets.last }
217
217
  subject { f1.reload.related_files }
@@ -22,7 +22,7 @@ describe GenericWork do
22
22
  end
23
23
 
24
24
  describe "to_sipity_entity" do
25
- let(:state) { FactoryGirl.create(:workflow_state) }
25
+ let(:state) { FactoryBot.create(:workflow_state) }
26
26
  let(:work) { create(:work) }
27
27
  before do
28
28
  Sipity::Entity.create!(proxy_for_global_id: work.to_global_id.to_s,
@@ -1,5 +1,5 @@
1
1
  describe Hyrax::UserUsageStats do
2
- subject { FactoryGirl.create(:user) }
2
+ subject { FactoryBot.create(:user) }
3
3
 
4
4
  describe 'with cached stats' do
5
5
  let!(:stat_1_day_ago) { UserStat.create!(user_id: subject.id, date: 1.day.ago, file_views: 3, file_downloads: 2, work_views: 5) }
@@ -17,7 +17,7 @@ module Sipity
17
17
  end
18
18
 
19
19
  describe '#proxy_for' do
20
- let(:work) { FactoryGirl.create(:generic_work) }
20
+ let(:work) { FactoryBot.create(:generic_work) }
21
21
  let(:entity) { Sipity::Entity.new(proxy_for_global_id: work.to_global_id) }
22
22
 
23
23
  it 'will retrieve based on a GlobalID of the object' do
@@ -1,10 +1,10 @@
1
1
  describe User, type: :model do
2
- let(:user) { FactoryGirl.build(:user) }
3
- let(:another_user) { FactoryGirl.build(:user) }
2
+ let(:user) { FactoryBot.build(:user) }
3
+ let(:another_user) { FactoryBot.build(:user) }
4
4
 
5
5
  describe 'verifying factories' do
6
6
  describe ':user' do
7
- let(:user) { FactoryGirl.build(:user) }
7
+ let(:user) { FactoryBot.build(:user) }
8
8
  it 'will, by default, have no groups' do
9
9
  expect(user.groups).to eq([])
10
10
  user.save!
@@ -12,7 +12,7 @@ describe User, type: :model do
12
12
  expect(user.class.find(user.id).groups).to eq([])
13
13
  end
14
14
  it 'will allow for override of groups' do
15
- user = FactoryGirl.build(:user, groups: 'chicken')
15
+ user = FactoryBot.build(:user, groups: 'chicken')
16
16
  expect(user.groups).to eq(['chicken'])
17
17
  user.save!
18
18
  # Ensuring that we can refind it and have the correct groups
@@ -20,7 +20,7 @@ describe User, type: :model do
20
20
  end
21
21
  end
22
22
  describe ':admin' do
23
- let(:admin_user) { FactoryGirl.create(:admin) }
23
+ let(:admin_user) { FactoryBot.create(:admin) }
24
24
  it 'will have an "admin" group' do
25
25
  expect(admin_user.groups).to eq(['admin'])
26
26
  end
@@ -201,8 +201,8 @@ describe User, type: :model do
201
201
  end
202
202
  end
203
203
  describe "scope Users" do
204
- let!(:basic_user) { FactoryGirl.create(:user) }
205
- let!(:guest_user) { FactoryGirl.create(:user, :guest) }
204
+ let!(:basic_user) { FactoryBot.create(:user) }
205
+ let!(:guest_user) { FactoryBot.create(:user, :guest) }
206
206
  let!(:audit_user) { User.audit_user }
207
207
  let!(:batch_user) { User.batch_user }
208
208