hyrax 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/app/services/hyrax/file_set_derivatives_service.rb +12 -4
- data/app/views/hyrax/collections/_collection_description.erb +1 -1
- data/hyrax.gemspec +8 -1
- data/lib/generators/hyrax/templates/config/hyrax.rb +4 -0
- data/lib/hyrax/configuration.rb +6 -0
- data/lib/hyrax/version.rb +1 -1
- data/spec/abilities/file_set_abilities_spec.rb +3 -3
- data/spec/abilities/generic_work_abilities_spec.rb +5 -5
- data/spec/actors/hyrax/actors/generic_work_actor_spec.rb +12 -12
- data/spec/actors/hyrax/actors/transactional_request_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/users_controller_spec.rb +3 -3
- data/spec/controllers/hyrax/api/items_controller_spec.rb +6 -6
- data/spec/controllers/hyrax/content_blocks_controller_spec.rb +2 -2
- data/spec/controllers/hyrax/downloads_controller_spec.rb +3 -3
- data/spec/controllers/hyrax/featured_work_lists_controller_spec.rb +2 -2
- data/spec/controllers/hyrax/homepage_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/tinymce_assets_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/users_controller_spec.rb +4 -4
- data/spec/controllers/hyrax/workflow_actions_controller_spec.rb +1 -1
- data/spec/conversions/power_converters/polymorphic_type_spec.rb +1 -1
- data/spec/factories/admin_sets.rb +1 -1
- data/spec/factories/api_items.rb +1 -1
- data/spec/factories/collections_factory.rb +2 -2
- data/spec/factories/content_blocks.rb +1 -1
- data/spec/factories/featured_works.rb +1 -1
- data/spec/factories/file_sets.rb +3 -3
- data/spec/factories/generic_works.rb +15 -15
- data/spec/factories/operations.rb +1 -1
- data/spec/factories/permission_template_accesses.rb +1 -1
- data/spec/factories/permission_templates.rb +1 -1
- data/spec/factories/proxy_deposit_requests.rb +2 -2
- data/spec/factories/single_use_links.rb +1 -1
- data/spec/factories/sipity_entities.rb +1 -1
- data/spec/factories/uploaded_files.rb +1 -1
- data/spec/factories/users.rb +2 -2
- data/spec/factories/workflow_actions.rb +1 -1
- data/spec/factories/workflow_states.rb +1 -1
- data/spec/factories/workflows.rb +1 -1
- data/spec/features/browse_dashboard_files_spec.rb +4 -4
- data/spec/features/notifications_spec.rb +1 -1
- data/spec/features/show_admin_set_spec.rb +11 -0
- data/spec/helpers/hyrax/collections_helper_spec.rb +2 -2
- data/spec/helpers/hyrax/content_block_helper_spec.rb +1 -1
- data/spec/helpers/hyrax/trophy_helper_spec.rb +1 -1
- data/spec/lib/hyrax/arkivo/actor_spec.rb +2 -2
- data/spec/lib/hyrax/arkivo/metadata_munger_spec.rb +1 -1
- data/spec/lib/hyrax/arkivo/schema_validator_spec.rb +1 -1
- data/spec/lib/hyrax/configuration_spec.rb +1 -0
- data/spec/models/file_set_spec.rb +1 -1
- data/spec/models/generic_work_spec.rb +1 -1
- data/spec/models/hyrax/user_usage_stats_spec.rb +1 -1
- data/spec/models/sipity/entity_spec.rb +1 -1
- data/spec/models/user_spec.rb +7 -7
- data/spec/presenters/hyrax/admin/users_presenter_spec.rb +2 -2
- data/spec/services/hyrax/embargo_service_spec.rb +4 -4
- data/spec/services/hyrax/repository_audit_service_spec.rb +1 -1
- data/spec/services/hyrax/workflow/permission_generator_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -6
- data/spec/support/features/session_helpers.rb +1 -1
- data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/base/_items.html.erb_spec.rb +2 -2
- data/spec/views/hyrax/base/file_manager.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/dashboard/index_spec.rb +1 -1
- data/template.rb +1 -1
- metadata +26 -4
@@ -1,7 +1,7 @@
|
|
1
1
|
describe Hyrax::Admin::UsersPresenter do
|
2
2
|
let(:instance) { described_class.new }
|
3
|
-
let!(:user) {
|
4
|
-
let!(:admin_user) {
|
3
|
+
let!(:user) { FactoryBot.create(:user) }
|
4
|
+
let!(:admin_user) { FactoryBot.create(:user, groups: 'admin') }
|
5
5
|
let!(:audit_user) { User.audit_user }
|
6
6
|
let!(:batch_user) { User.batch_user }
|
7
7
|
|
@@ -6,19 +6,19 @@ describe Hyrax::EmbargoService do
|
|
6
6
|
let(:past_date) { 2.days.ago }
|
7
7
|
|
8
8
|
let!(:work_with_expired_embargo1) do
|
9
|
-
|
9
|
+
FactoryBot.build(:generic_work, embargo_release_date: past_date.to_s).tap do |work|
|
10
10
|
work.save(validate: false)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
let!(:work_with_expired_embargo2) do
|
15
|
-
|
15
|
+
FactoryBot.build(:generic_work, embargo_release_date: past_date.to_s).tap do |work|
|
16
16
|
work.save(validate: false)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
let!(:work_with_embargo_in_effect) {
|
21
|
-
let!(:work_without_embargo) {
|
20
|
+
let!(:work_with_embargo_in_effect) { FactoryBot.create(:generic_work, embargo_release_date: future_date.to_s) }
|
21
|
+
let!(:work_without_embargo) { FactoryBot.create(:generic_work) }
|
22
22
|
|
23
23
|
describe '#assets_with_expired_embargoes' do
|
24
24
|
it 'returns an array of assets with expired embargoes' do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
describe Hyrax::RepositoryAuditService do
|
2
|
-
let(:user) {
|
2
|
+
let(:user) { FactoryBot.create(:user) }
|
3
3
|
let!(:file) do
|
4
4
|
FileSet.create! do |file|
|
5
5
|
file.add_file(File.open(fixture_path + '/world.png'), path: 'content', original_name: 'world.png')
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
module Hyrax
|
4
4
|
module Workflow
|
5
5
|
RSpec.describe PermissionGenerator do
|
6
|
-
let(:user) {
|
6
|
+
let(:user) { FactoryBot.create(:user) }
|
7
7
|
let(:role) { Sipity::Role.create!(name: 'creating_user') }
|
8
8
|
let(:workflow) { create(:workflow, name: 'workflow') }
|
9
9
|
let(:workflow_state) { workflow.initial_workflow_state }
|
data/spec/spec_helper.rb
CHANGED
@@ -21,7 +21,7 @@ if coverage_needed?
|
|
21
21
|
SimpleCov.command_name 'spec'
|
22
22
|
end
|
23
23
|
|
24
|
-
require '
|
24
|
+
require 'factory_bot'
|
25
25
|
require 'engine_cart'
|
26
26
|
EngineCart.load_application!
|
27
27
|
|
@@ -111,7 +111,7 @@ end
|
|
111
111
|
|
112
112
|
class JsonStrategy
|
113
113
|
def initialize
|
114
|
-
@strategy =
|
114
|
+
@strategy = FactoryBot.strategy_by_name(:create).new
|
115
115
|
end
|
116
116
|
|
117
117
|
delegate :association, to: :@strategy
|
@@ -121,9 +121,9 @@ class JsonStrategy
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
FactoryBot.register_strategy(:json, JsonStrategy)
|
125
|
+
FactoryBot.definition_file_paths = [File.expand_path("../factories", __FILE__)]
|
126
|
+
FactoryBot.find_definitions
|
127
127
|
|
128
128
|
module EngineRoutes
|
129
129
|
def self.included(base)
|
@@ -222,7 +222,7 @@ RSpec.configure do |config|
|
|
222
222
|
|
223
223
|
config.include Capybara::RSpecMatchers, type: :input
|
224
224
|
config.include InputSupport, type: :input
|
225
|
-
config.include
|
225
|
+
config.include FactoryBot::Syntax::Methods
|
226
226
|
|
227
227
|
config.infer_spec_type_from_file_location!
|
228
228
|
|
@@ -3,7 +3,7 @@ module Features
|
|
3
3
|
module SessionHelpers
|
4
4
|
def sign_in(who = :user)
|
5
5
|
logout
|
6
|
-
user = who.is_a?(User) ? who :
|
6
|
+
user = who.is_a?(User) ? who : FactoryBot.build(:user).tap(&:save!)
|
7
7
|
visit new_user_session_path
|
8
8
|
fill_in 'Email', with: user.email
|
9
9
|
fill_in 'Password', with: user.password
|
@@ -3,7 +3,7 @@ describe 'hyrax/admin/users/index.html.erb', type: :view do
|
|
3
3
|
let(:users) { [] }
|
4
4
|
|
5
5
|
before do
|
6
|
-
(1..4).each { |i| users <<
|
6
|
+
(1..4).each { |i| users << FactoryBot.build(:user, display_name: "user#{i}", email: "email#{i}@example.com", last_sign_in_at: Time.zone.now - 15.minutes, created_at: Time.zone.now - 3.days) }
|
7
7
|
allow(presenter).to receive(:users).and_return(users)
|
8
8
|
assign(:presenter, presenter)
|
9
9
|
end
|
@@ -8,7 +8,7 @@ describe 'hyrax/base/items', type: :view do
|
|
8
8
|
let(:solr_doc) { double(id: '123', human_readable_type: 'Work') }
|
9
9
|
let(:solr_doc_file) do
|
10
10
|
SolrDocument.new(
|
11
|
-
|
11
|
+
FactoryBot.build(:file_set).to_solr.merge(
|
12
12
|
id: "file",
|
13
13
|
title_tesim: ["Child File"],
|
14
14
|
label_tesim: ["ChildFile.pdf"]
|
@@ -17,7 +17,7 @@ describe 'hyrax/base/items', type: :view do
|
|
17
17
|
end
|
18
18
|
let(:solr_doc_work) do
|
19
19
|
SolrDocument.new(
|
20
|
-
|
20
|
+
FactoryBot.build(:generic_work).to_solr.merge(
|
21
21
|
id: "work",
|
22
22
|
title_tesim: ["Child Work"]
|
23
23
|
)
|
@@ -105,7 +105,7 @@ RSpec.describe "hyrax/dashboard/index.html.erb", type: :view do
|
|
105
105
|
|
106
106
|
context "with notifications" do
|
107
107
|
before do
|
108
|
-
assign(:notifications,
|
108
|
+
assign(:notifications, FactoryBot.create(:user_with_mail).mailbox.inbox)
|
109
109
|
end
|
110
110
|
|
111
111
|
it "shows a link to all notifications" do
|
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: 1.0
|
4
|
+
version: 1.1.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: 2018-04-17 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: hydra-head
|
@@ -833,7 +833,7 @@ dependencies:
|
|
833
833
|
- !ruby/object:Gem::Version
|
834
834
|
version: '1.5'
|
835
835
|
- !ruby/object:Gem::Dependency
|
836
|
-
name:
|
836
|
+
name: factory_bot_rails
|
837
837
|
requirement: !ruby/object:Gem::Requirement
|
838
838
|
requirements:
|
839
839
|
- - "~>"
|
@@ -972,6 +972,26 @@ dependencies:
|
|
972
972
|
- - ">="
|
973
973
|
- !ruby/object:Gem::Version
|
974
974
|
version: '0'
|
975
|
+
- !ruby/object:Gem::Dependency
|
976
|
+
name: simple_form
|
977
|
+
requirement: !ruby/object:Gem::Requirement
|
978
|
+
requirements:
|
979
|
+
- - "~>"
|
980
|
+
- !ruby/object:Gem::Version
|
981
|
+
version: '3.2'
|
982
|
+
- - "<="
|
983
|
+
- !ruby/object:Gem::Version
|
984
|
+
version: 3.5.0
|
985
|
+
type: :runtime
|
986
|
+
prerelease: false
|
987
|
+
version_requirements: !ruby/object:Gem::Requirement
|
988
|
+
requirements:
|
989
|
+
- - "~>"
|
990
|
+
- !ruby/object:Gem::Version
|
991
|
+
version: '3.2'
|
992
|
+
- - "<="
|
993
|
+
- !ruby/object:Gem::Version
|
994
|
+
version: 3.5.0
|
975
995
|
description: Hyrax is a featureful Samvera front-end based on the latest and greatest
|
976
996
|
Samvera software components.
|
977
997
|
email:
|
@@ -2173,6 +2193,7 @@ files:
|
|
2173
2193
|
- spec/features/ownership_transfer_spec.rb
|
2174
2194
|
- spec/features/proxy_spec.rb
|
2175
2195
|
- spec/features/search_spec.rb
|
2196
|
+
- spec/features/show_admin_set_spec.rb
|
2176
2197
|
- spec/features/static_pages_spec.rb
|
2177
2198
|
- spec/features/user_admin_set_spec.rb
|
2178
2199
|
- spec/features/users_spec.rb
|
@@ -2627,7 +2648,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2627
2648
|
version: '0'
|
2628
2649
|
requirements: []
|
2629
2650
|
rubyforge_project:
|
2630
|
-
rubygems_version: 2.6.
|
2651
|
+
rubygems_version: 2.6.13
|
2631
2652
|
signing_key:
|
2632
2653
|
specification_version: 4
|
2633
2654
|
summary: Hyrax is a front-end based on the robust Samvera framework, providing a user
|
@@ -2762,6 +2783,7 @@ test_files:
|
|
2762
2783
|
- spec/features/ownership_transfer_spec.rb
|
2763
2784
|
- spec/features/proxy_spec.rb
|
2764
2785
|
- spec/features/search_spec.rb
|
2786
|
+
- spec/features/show_admin_set_spec.rb
|
2765
2787
|
- spec/features/static_pages_spec.rb
|
2766
2788
|
- spec/features/user_admin_set_spec.rb
|
2767
2789
|
- spec/features/users_spec.rb
|