sufia 6.2.0 → 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +146 -0
- data/.travis.yml +4 -7
- data/Gemfile +2 -0
- data/History.md +29 -1
- data/README.md +25 -9
- data/SUFIA_VERSION +1 -1
- data/app/assets/stylesheets/sufia/_collections.scss +15 -0
- data/app/assets/stylesheets/sufia/_file-listing.scss +7 -0
- data/app/assets/stylesheets/sufia/_home-page.scss +10 -0
- data/app/builders/sufia/bootstrap_breadcrumbs_builder.rb +3 -5
- data/app/controllers/admin/stats_controller.rb +1 -76
- data/app/controllers/api/items_controller.rb +4 -6
- data/app/controllers/api/zotero_controller.rb +5 -5
- data/app/controllers/authorities_controller.rb +5 -1
- data/app/controllers/batch_edits_controller.rb +3 -3
- data/app/controllers/concerns/sufia/admin/depositor_stats.rb +41 -0
- data/app/controllers/concerns/sufia/admin/stats_behavior.rb +94 -0
- data/app/controllers/concerns/sufia/batch_controller_behavior.rb +16 -18
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +54 -56
- data/app/controllers/concerns/sufia/breadcrumbs.rb +3 -6
- data/app/controllers/concerns/sufia/collections_controller_behavior.rb +39 -39
- data/app/controllers/concerns/sufia/controller.rb +10 -10
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +17 -18
- data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +9 -12
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +6 -7
- data/app/controllers/concerns/sufia/files_controller/local_ingest_behavior.rb +39 -40
- data/app/controllers/concerns/sufia/files_controller/upload_complete_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +109 -110
- data/app/controllers/concerns/sufia/homepage_controller.rb +8 -8
- data/app/controllers/concerns/sufia/my_controller_behavior.rb +13 -10
- data/app/controllers/concerns/sufia/single_use_links_controller_behavior.rb +11 -14
- data/app/controllers/concerns/sufia/single_use_links_viewer_controller_behavior.rb +27 -21
- data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +17 -17
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +54 -54
- data/app/controllers/contact_form_controller.rb +1 -1
- data/app/controllers/content_blocks_controller.rb +11 -12
- data/app/controllers/directory_controller.rb +2 -3
- data/app/controllers/featured_work_lists_controller.rb +1 -1
- data/app/controllers/featured_works_controller.rb +2 -4
- data/app/controllers/homepage_controller.rb +1 -2
- data/app/controllers/mailbox_controller.rb +12 -32
- data/app/controllers/my/collections_controller.rb +3 -4
- data/app/controllers/my/files_controller.rb +4 -6
- data/app/controllers/my/highlights_controller.rb +4 -6
- data/app/controllers/my/shares_controller.rb +3 -5
- data/app/controllers/pages_controller.rb +1 -3
- data/app/controllers/single_use_links_controller.rb +0 -1
- data/app/controllers/single_use_links_viewer_controller.rb +0 -1
- data/app/controllers/static_controller.rb +1 -0
- data/app/forms/sufia/forms/collection_edit_form.rb +2 -2
- data/app/helpers/batch_edits_helper.rb +1 -3
- data/app/helpers/content_block_helper.rb +7 -8
- data/app/helpers/generic_file_helper.rb +23 -24
- data/app/helpers/sufia/blacklight_override.rb +6 -7
- data/app/helpers/sufia/dashboard_helper_behavior.rb +4 -7
- data/app/helpers/sufia/permissions_helper.rb +3 -4
- data/app/helpers/sufia/sufia_helper_behavior.rb +30 -29
- data/app/helpers/trophy_helper.rb +15 -15
- data/app/inputs/select_with_modal_help_input.rb +3 -3
- data/app/inputs/with_help_icon.rb +4 -4
- data/app/jobs/content_delete_event_job.rb +0 -1
- data/app/jobs/content_depositor_change_event_job.rb +1 -2
- data/app/jobs/event_job.rb +0 -1
- data/app/jobs/user_unfollow_event_job.rb +1 -0
- data/app/models/concerns/sufia/solr_document_behavior.rb +1 -2
- data/app/models/contact_form.rb +6 -6
- data/app/models/content_block.rb +1 -2
- data/app/models/featured_work_list.rb +3 -5
- data/app/models/user_mailbox.rb +44 -0
- data/app/presenters/sufia/collection_presenter.rb +6 -8
- data/app/presenters/sufia/generic_file_presenter.rb +2 -2
- data/app/presenters/sufia/presenter_renderer.rb +2 -2
- data/app/presenters/sufia/version_list_presenter.rb +1 -1
- data/app/presenters/sufia/version_presenter.rb +3 -6
- data/app/search_builders/deposit_search_builder.rb +19 -0
- data/app/search_builders/sufia/my_search_builder_behavior.rb +1 -2
- data/app/search_builders/sufia/search_builder.rb +1 -3
- data/app/uploaders/tinymce_asset_uploader.rb +0 -2
- data/app/views/_controls.html.erb +5 -5
- data/app/views/admin/stats/_deposits.html.erb +19 -0
- data/app/views/admin/stats/index.html.erb +2 -0
- data/app/views/batch_edits/edit.html.erb +2 -2
- data/app/views/collections/_edit_actions.html.erb +3 -3
- data/app/views/collections/_form_for_select_collection.html.erb +2 -2
- data/app/views/collections/_sort_and_per_page.html.erb +12 -9
- data/app/views/collections/_view_type_group.html.erb +1 -1
- data/app/views/collections/edit.html.erb +5 -5
- data/app/views/collections/show.html.erb +7 -6
- data/app/views/homepage/_announcement.html.erb +5 -0
- data/app/views/homepage/_home.html.erb +1 -0
- data/app/views/my/_sort_and_per_page.html.erb +14 -10
- data/app/views/my/index.html.erb +1 -1
- data/app/views/pages/show.html.erb +0 -2
- data/app/views/single_use_links/new_download.html.erb +1 -1
- data/app/views/single_use_links_viewer/show.html.erb +1 -1
- data/app/views/users/_notify_link.html.erb +1 -1
- data/app/views/users/_notify_number.html.erb +2 -2
- data/config/initializers/simple_form.rb +1 -1
- data/config/initializers/simple_form_bootstrap.rb +1 -1
- data/config/locales/sufia.en.yml +4 -0
- data/config/routes.rb +2 -3
- data/lib/generators/sufia/admin_stat_generator.rb +0 -3
- data/lib/generators/sufia/install_generator.rb +8 -9
- data/lib/generators/sufia/templates/catalog_controller.rb +2 -3
- data/lib/generators/sufia/templates/config/action_dispatch_http_upload_monkey_patch.rb +1 -0
- data/lib/generators/sufia/upgrade400_generator.rb +9 -9
- data/lib/generators/sufia/upgrade600_generator.rb +1 -4
- data/lib/sufia.rb +2 -2
- data/lib/sufia/arkivo/actor.rb +1 -1
- data/lib/sufia/arkivo/create_subscription_job.rb +30 -30
- data/lib/sufia/arkivo/metadata_munger.rb +7 -7
- data/lib/sufia/arkivo/schema_validator.rb +1 -1
- data/lib/sufia/single_use_error.rb +0 -1
- data/lib/sufia/version.rb +1 -1
- data/lib/sufia/zotero/config.rb +13 -13
- data/spec/actors/generic_file/actor_spec.rb +17 -18
- data/spec/controllers/admin_stats_controller_spec.rb +56 -5
- data/spec/controllers/api/zotero_controller_spec.rb +10 -9
- data/spec/controllers/authorities_controller_spec.rb +8 -8
- data/spec/controllers/batch_controller_spec.rb +19 -20
- data/spec/controllers/batch_edits_controller_spec.rb +8 -9
- data/spec/controllers/catalog_controller_spec.rb +7 -9
- data/spec/controllers/collections_controller_spec.rb +30 -32
- data/spec/controllers/content_blocks_controller_spec.rb +4 -4
- data/spec/controllers/dashboard_controller_spec.rb +12 -12
- data/spec/controllers/depositors_controller_spec.rb +8 -8
- data/spec/controllers/downloads_controller_spec.rb +10 -11
- data/spec/controllers/featured_work_lists_controller_spec.rb +4 -4
- data/spec/controllers/featured_works_controller_spec.rb +11 -12
- data/spec/controllers/generic_files_controller_spec.rb +154 -125
- data/spec/controllers/homepage_controller_spec.rb +22 -15
- data/spec/controllers/mailbox_controller_spec.rb +20 -36
- data/spec/controllers/my/collections_controller_spec.rb +4 -5
- data/spec/controllers/my/files_controller_spec.rb +10 -11
- data/spec/controllers/my/highlights_controller_spec.rb +4 -5
- data/spec/controllers/my/shares_controller_spec.rb +12 -14
- data/spec/controllers/my_controller_spec.rb +1 -3
- data/spec/controllers/pages_controller_spec.rb +4 -4
- data/spec/controllers/single_use_links_controller_spec.rb +1 -3
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +1 -2
- data/spec/controllers/static_controller_spec.rb +1 -1
- data/spec/controllers/tinymce_assets_controller_spec.rb +8 -9
- data/spec/controllers/transfers_controller_spec.rb +19 -19
- data/spec/controllers/users_controller_spec.rb +33 -35
- data/spec/factories/api_items.rb +2 -2
- data/spec/factories/content_blocks.rb +1 -1
- data/spec/factories/featured_works.rb +1 -1
- data/spec/factories/generic_files.rb +3 -3
- data/spec/factories/users.rb +7 -8
- data/spec/features/browse_dashboard_files_spec.rb +14 -18
- data/spec/features/browse_files_spec.rb +3 -4
- data/spec/features/catalog_search_spec.rb +3 -5
- data/spec/features/cloud_upload_spec.rb +2 -2
- data/spec/features/collection_spec.rb +21 -21
- data/spec/features/contact_form_spec.rb +10 -11
- data/spec/features/display_dashboard_spec.rb +5 -9
- data/spec/features/edit_file_spec.rb +8 -9
- data/spec/features/featured_item_spec.rb +1 -1
- data/spec/features/ingest_upload_files_spec.rb +5 -5
- data/spec/features/notifications_spec.rb +2 -6
- data/spec/features/ownership_transfer_spec.rb +2 -2
- data/spec/features/proxy_spec.rb +2 -2
- data/spec/features/search_spec.rb +3 -4
- data/spec/features/single_use_links_spec.rb +1 -1
- data/spec/features/users_spec.rb +4 -5
- data/spec/forms/collection_edit_form_spec.rb +2 -2
- data/spec/forms/generic_file_edit_form_spec.rb +6 -7
- data/spec/helpers/batch_edits_helper_spec.rb +9 -13
- data/spec/helpers/content_block_helper_spec.rb +3 -3
- data/spec/helpers/dashboard_helper_spec.rb +19 -24
- data/spec/helpers/generic_file_helper_spec.rb +5 -7
- data/spec/helpers/sufia_helper_spec.rb +43 -54
- data/spec/helpers/trophy_helper_spec.rb +5 -5
- data/spec/inputs/multi_value_with_help_input_spec.rb +1 -2
- data/spec/inputs/select_with_help_input_spec.rb +19 -15
- data/spec/javascripts/jasmine_spec.rb +4 -5
- data/spec/javascripts/support/jasmine_helper.rb +9 -9
- data/spec/jobs/active_fedora_id_based_job_spec.rb +7 -5
- data/spec/jobs/audit_job_spec.rb +7 -7
- data/spec/jobs/batch_update_job_spec.rb +5 -6
- data/spec/jobs/characterize_job_spec.rb +1 -1
- data/spec/jobs/content_depositor_change_event_job_spec.rb +1 -1
- data/spec/jobs/create_derivatives_job_spec.rb +5 -5
- data/spec/jobs/event_jobs_spec.rb +16 -16
- data/spec/jobs/import_url_job_spec.rb +36 -5
- data/spec/jobs/ingest_local_file_job_spec.rb +31 -20
- data/spec/jobs/sufia_resque_queue_spec.rb +1 -1
- data/spec/lib/sufia/analytics_spec.rb +0 -1
- data/spec/lib/sufia/arkivo/actor_spec.rb +6 -6
- data/spec/lib/sufia/arkivo/schema_validator_spec.rb +18 -18
- data/spec/lib/sufia/breadcrumbs_spec.rb +5 -6
- data/spec/lib/sufia/messages_spec.rb +11 -12
- data/spec/lib/sufia/readable_permissions_spec.rb +8 -10
- data/spec/lib/sufia/upload_complete_behavior_spec.rb +6 -7
- data/spec/lib/sufia/user_stat_importer_spec.rb +30 -33
- data/spec/lib/sufia/writable_permissions_spec.rb +1 -3
- data/spec/lib/sufia/zotero/config_spec.rb +4 -6
- data/spec/models/ability_spec.rb +11 -9
- data/spec/models/batch_spec.rb +13 -13
- data/spec/models/characterization_spec.rb +2 -3
- data/spec/models/checksum_audit_log_spec.rb +18 -19
- data/spec/models/collection_spec.rb +11 -12
- data/spec/models/content_block_spec.rb +33 -22
- data/spec/models/download_spec.rb +3 -5
- data/spec/models/featured_work_list_spec.rb +3 -3
- data/spec/models/featured_work_spec.rb +12 -14
- data/spec/models/file_content_datastream_spec.rb +9 -7
- data/spec/models/file_download_stat_spec.rb +34 -40
- data/spec/models/file_usage_spec.rb +46 -52
- data/spec/models/file_view_stat_spec.rb +35 -41
- data/spec/models/fits_datastream_spec.rb +23 -25
- data/spec/models/generic_file/visibility_spec.rb +10 -5
- data/spec/models/generic_file_spec.rb +86 -88
- data/spec/models/geo_names_resource_spec.rb +3 -5
- data/spec/models/local_authority_spec.rb +30 -33
- data/spec/models/pageview_spec.rb +3 -3
- data/spec/models/proxy_deposit_request_spec.rb +3 -3
- data/spec/models/single_use_link_spec.rb +36 -36
- data/spec/models/solr_document_spec.rb +3 -6
- data/spec/models/trophy_spec.rb +8 -9
- data/spec/models/user_mailbox_spec.rb +62 -0
- data/spec/models/user_spec.rb +28 -29
- data/spec/presenters/presenter_renderer_spec.rb +1 -1
- data/spec/presenters/sufia/generic_file_presenter_spec.rb +5 -5
- data/spec/presenters/sufia/version_list_presenter_spec.rb +2 -2
- data/spec/presenters/sufia/version_presenter_spec.rb +1 -1
- data/spec/routing/featured_works_route_spec.rb +4 -4
- data/spec/routing/ownership_transfers_route_spec.rb +1 -1
- data/spec/routing/route_spec.rb +89 -89
- data/spec/services/generic_file_audit_service_spec.rb +8 -8
- data/spec/services/repository_audit_service_spec.rb +7 -3
- data/spec/spec_helper.rb +5 -4
- data/spec/support/features/session_helpers.rb +1 -1
- data/spec/support/input_support.rb +1 -2
- data/spec/support/rake.rb +1 -1
- data/spec/support/selectors.rb +1 -6
- data/spec/support/statistic_helper.rb +1 -1
- data/spec/support/uploaded_file_monkeypatch.rb +1 -1
- data/spec/tasks/rake_spec.rb +3 -5
- data/spec/views/admin/stats/index.html.erb_spec.rb +16 -16
- data/spec/views/batch/edit.html.erb_spec.rb +1 -3
- data/spec/views/batch_edits/check_all_spec.rb +5 -5
- data/spec/views/batch_edits/edit.html.erb_spec.rb +1 -3
- data/spec/views/catalog/index.html.erb_spec.rb +1 -3
- data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +4 -5
- data/spec/views/collections/_form.html.erb_spec.rb +5 -3
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +7 -8
- data/spec/views/collections/_show_document_list.erb_spec.rb +4 -6
- data/spec/views/dashboard/index_spec.rb +14 -21
- data/spec/views/generic_file/_browse_everything.html.erb_spec.rb +2 -2
- data/spec/views/generic_file/_permission_form.html.erb_spec.rb +8 -9
- data/spec/views/generic_file/edit.html.erb_spec.rb +7 -7
- data/spec/views/generic_file/show.html.erb_spec.rb +24 -25
- data/spec/views/generic_file/stats.html.erb_spec.rb +19 -19
- data/spec/views/homepage/_announcement.html.erb_spec.rb +51 -0
- data/spec/views/homepage/_featured_works.html.erb_spec.rb +5 -9
- data/spec/views/homepage/_home_header.html.erb_spec.rb +2 -2
- data/spec/views/my/facet.html.erb_spec.rb +4 -4
- data/spec/views/single_use_links/new_download.html.erb_spec.rb +28 -0
- data/spec/views/single_use_links_viewer/show.html.erb_spec.rb +29 -0
- data/spec/views/users/_follower_modal.html.erb_spec.rb +7 -8
- data/spec/views/users/_following_modal.html.erb_spec.rb +4 -5
- data/spec/views/users/_notify_number.html.erb_spec.rb +2 -5
- data/spec/views/users/_user_util_links.html.erb_spec.rb +5 -8
- data/spec/views/users/index.html.erb_spec.rb +4 -6
- data/spec/views/users/show.html.erb_spec.rb +4 -7
- data/tasks/sufia-dev.rake +19 -3
- metadata +20 -5
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Sufia::PresenterRenderer, type: :view do
|
4
4
|
let(:generic_file) { GenericFile.new }
|
5
5
|
let(:presenter) { Sufia::GenericFilePresenter.new(generic_file) }
|
6
|
-
let(:renderer) {
|
6
|
+
let(:renderer) { described_class.new(presenter, view) }
|
7
7
|
|
8
8
|
describe "#label" do
|
9
9
|
context "of a field with a translation" do
|
@@ -2,15 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Sufia::GenericFilePresenter do
|
4
4
|
describe ".terms" do
|
5
|
-
it "
|
5
|
+
it "returns a list" do
|
6
6
|
expect(described_class.terms).to eq([:resource_type, :title,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
:creator, :contributor, :description, :tag, :rights, :publisher,
|
8
|
+
:date_created, :subject, :language, :identifier, :based_near,
|
9
|
+
:related_url])
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
let(:presenter) {
|
13
|
+
let(:presenter) { described_class.new(file) }
|
14
14
|
|
15
15
|
describe '#tweeter' do
|
16
16
|
let(:file) { build(:generic_file).tap { |f| f.apply_depositor_metadata(user) } }
|
@@ -17,10 +17,10 @@ describe Sufia::VersionListPresenter, :no_clean do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
subject {
|
20
|
+
subject { described_class.new([resource_version, resource_version2]) }
|
21
21
|
|
22
22
|
describe "#each" do
|
23
|
-
it "
|
23
|
+
it "yields version_presenters" do
|
24
24
|
versions_descending = []
|
25
25
|
subject.each do |v|
|
26
26
|
expect(v).to be_kind_of Sufia::VersionPresenter
|
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe "file routes", :
|
3
|
+
describe "file routes", type: :routing do
|
4
4
|
routes { Sufia::Engine.routes }
|
5
|
-
it '
|
5
|
+
it 'creates a featured_work' do
|
6
6
|
expect(post: '/files/1/featured_work').to route_to(controller: 'featured_works', action: 'create', id: '1')
|
7
7
|
end
|
8
|
-
it '
|
8
|
+
it 'removes a featured_work' do
|
9
9
|
expect(delete: '/files/1/featured_work').to route_to(controller: 'featured_works', action: 'destroy', id: '1')
|
10
10
|
end
|
11
11
|
|
12
|
-
it '
|
12
|
+
it 'updates a collection of featured works' do
|
13
13
|
expect(featured_work_lists_path).to eq '/featured_works'
|
14
14
|
expect(post: '/featured_works').to route_to(controller: 'featured_work_lists', action: 'create')
|
15
15
|
end
|
data/spec/routing/route_spec.rb
CHANGED
@@ -1,210 +1,210 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe 'Routes', :
|
3
|
+
describe 'Routes', type: :routing do
|
4
4
|
routes { Sufia::Engine.routes }
|
5
5
|
|
6
6
|
describe 'Homepage' do
|
7
|
-
it '
|
8
|
-
expect(
|
7
|
+
it 'routes the root url to the homepage controller' do
|
8
|
+
expect(get: '/').to route_to(controller: 'homepage', action: 'index')
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GenericFile' do
|
13
|
-
it '
|
14
|
-
expect(
|
13
|
+
it 'routes to citation' do
|
14
|
+
expect(get: '/files/1/citation').to route_to(controller: 'generic_files', action: 'citation', id: '1')
|
15
15
|
end
|
16
16
|
|
17
|
-
it '
|
18
|
-
expect(
|
17
|
+
it 'routes to stats' do
|
18
|
+
expect(get: '/files/1/stats').to route_to(controller: 'generic_files', action: 'stats', id: '1')
|
19
19
|
end
|
20
20
|
|
21
|
-
it '
|
22
|
-
expect(
|
21
|
+
it 'routes to audit' do
|
22
|
+
expect(post: '/files/7/audit').to route_to(controller: 'generic_files', action: 'audit', id: '7')
|
23
23
|
end
|
24
24
|
|
25
|
-
it '
|
26
|
-
expect(
|
25
|
+
it 'routes to create' do
|
26
|
+
expect(post: '/files').to route_to(controller: 'generic_files', action: 'create')
|
27
27
|
end
|
28
28
|
|
29
|
-
it '
|
30
|
-
expect(
|
29
|
+
it 'routes to new' do
|
30
|
+
expect(get: '/files/new').to route_to(controller: 'generic_files', action: 'new')
|
31
31
|
end
|
32
32
|
|
33
|
-
it '
|
34
|
-
expect(
|
33
|
+
it 'routes to edit' do
|
34
|
+
expect(get: '/files/3/edit').to route_to(controller: 'generic_files', action: 'edit', id: '3')
|
35
35
|
end
|
36
36
|
|
37
|
-
it "
|
38
|
-
expect(
|
37
|
+
it "routes to show" do
|
38
|
+
expect(get: '/files/4').to route_to(controller: 'generic_files', action: 'show', id: '4')
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
42
|
-
expect(
|
41
|
+
it "routes to update" do
|
42
|
+
expect(put: '/files/5').to route_to(controller: 'generic_files', action: 'update', id: '5')
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
46
|
-
expect(
|
45
|
+
it "routes to destroy" do
|
46
|
+
expect(delete: '/files/6').to route_to(controller: 'generic_files', action: 'destroy', id: '6')
|
47
47
|
end
|
48
48
|
|
49
|
-
it "
|
50
|
-
expect(
|
49
|
+
it "*not*s route to index" do
|
50
|
+
expect(get: '/files').not_to route_to(controller: 'generic_files', action: 'index')
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe 'Batch' do
|
55
|
-
it "
|
56
|
-
expect(
|
55
|
+
it "routes to edit" do
|
56
|
+
expect(get: '/batches/1/edit').to route_to(controller: 'batch', action: 'edit', id: '1')
|
57
57
|
end
|
58
58
|
|
59
|
-
it "
|
60
|
-
expect(
|
59
|
+
it "routes to update" do
|
60
|
+
expect(post: '/batches/2').to route_to(controller: 'batch', action: 'update', id: '2')
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
describe 'Download' do
|
65
|
-
it "
|
66
|
-
expect(
|
65
|
+
it "routes to show" do
|
66
|
+
expect(get: '/downloads/9').to route_to(controller: 'downloads', action: 'show', id: '9')
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
describe 'Dashboard' do
|
71
|
-
it "
|
72
|
-
expect(
|
71
|
+
it "routes to dashboard" do
|
72
|
+
expect(get: '/dashboard').to route_to(controller: 'dashboard', action: 'index')
|
73
73
|
end
|
74
74
|
|
75
|
-
it "
|
76
|
-
expect(
|
75
|
+
it "routes to dashboard activity" do
|
76
|
+
expect(get: '/dashboard/activity').to route_to(controller: 'dashboard', action: 'activity')
|
77
77
|
end
|
78
78
|
|
79
|
-
it "
|
80
|
-
expect(
|
79
|
+
it "routes to my files tab" do
|
80
|
+
expect(get: '/dashboard/files').to route_to(controller: 'my/files', action: 'index')
|
81
81
|
end
|
82
82
|
|
83
|
-
it "
|
84
|
-
expect(
|
83
|
+
it "routes to my collections tab" do
|
84
|
+
expect(get: '/dashboard/collections').to route_to(controller: 'my/collections', action: 'index')
|
85
85
|
end
|
86
86
|
|
87
|
-
it "
|
88
|
-
expect(
|
87
|
+
it "routes to my highlighted tab" do
|
88
|
+
expect(get: '/dashboard/highlights').to route_to(controller: 'my/highlights', action: 'index')
|
89
89
|
end
|
90
90
|
|
91
|
-
it "
|
92
|
-
expect(
|
91
|
+
it "routes to my shared tab" do
|
92
|
+
expect(get: '/dashboard/shares').to route_to(controller: 'my/shares', action: 'index')
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
describe 'Advanced Search' do
|
97
|
-
it "
|
98
|
-
expect(
|
97
|
+
it "routes to search" do
|
98
|
+
expect(get: '/search').to route_to(controller: 'advanced', action: 'index')
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
102
|
describe 'Authorities' do
|
103
|
-
it "
|
104
|
-
expect(
|
103
|
+
it "routes to query" do
|
104
|
+
expect(get: '/authorities/subject/bio').to route_to(controller: 'authorities', action: 'query', model: 'subject', term: 'bio')
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
describe 'Users' do
|
109
|
-
it '
|
110
|
-
expect(
|
109
|
+
it 'routes to user trophies' do
|
110
|
+
expect(post: '/users/bob135/trophy').to route_to(controller: 'users', action: 'toggle_trophy', id: 'bob135')
|
111
111
|
end
|
112
|
-
it '
|
113
|
-
expect(
|
112
|
+
it 'routes to user profile' do
|
113
|
+
expect(get: '/users/bob135').to route_to(controller: 'users', action: 'show', id: 'bob135')
|
114
114
|
end
|
115
115
|
|
116
|
-
it "
|
117
|
-
expect(
|
116
|
+
it "routes to edit profile" do
|
117
|
+
expect(get: '/users/bob135/edit').to route_to(controller: 'users', action: 'edit', id: 'bob135')
|
118
118
|
end
|
119
119
|
|
120
|
-
it "
|
121
|
-
expect(
|
120
|
+
it "routes to update profile" do
|
121
|
+
expect(put: '/users/bob135').to route_to(controller: 'users', action: 'update', id: 'bob135')
|
122
122
|
end
|
123
123
|
|
124
|
-
it "
|
125
|
-
expect(
|
124
|
+
it "routes to user follow" do
|
125
|
+
expect(post: '/users/bob135/follow').to route_to(controller: 'users', action: 'follow', id: 'bob135')
|
126
126
|
end
|
127
127
|
|
128
|
-
it "
|
129
|
-
expect(
|
128
|
+
it "routes to user unfollow" do
|
129
|
+
expect(post: '/users/bob135/unfollow').to route_to(controller: 'users', action: 'unfollow', id: 'bob135')
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
133
|
describe "Directory" do
|
134
|
-
it "
|
135
|
-
expect(
|
134
|
+
it "routes to user" do
|
135
|
+
expect(get: '/directory/user/xxx666').to route_to(controller: 'directory', action: 'user', uid: 'xxx666')
|
136
136
|
end
|
137
137
|
|
138
|
-
it "
|
139
|
-
expect(
|
138
|
+
it "routes to user attribute" do
|
139
|
+
expect(get: '/directory/user/zzz777/email').to route_to(controller: 'directory', action: 'user_attribute', uid: 'zzz777', attribute: 'email')
|
140
140
|
end
|
141
141
|
|
142
|
-
it "
|
143
|
-
expect(
|
142
|
+
it "routes to group and allow periods" do
|
143
|
+
expect(get: '/directory/group/all.staff').to route_to(controller: 'directory', action: 'group', cn: 'all.staff')
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
147
|
describe "Notifications" do
|
148
|
-
it "
|
149
|
-
expect(
|
148
|
+
it "has index" do
|
149
|
+
expect(get: '/notifications').to route_to(controller: 'mailbox', action: 'index')
|
150
150
|
expect(notifications_path).to eq '/notifications'
|
151
151
|
end
|
152
|
-
it "
|
153
|
-
expect(
|
152
|
+
it "allows deleting" do
|
153
|
+
expect(delete: '/notifications/123').to route_to(controller: 'mailbox', action: 'destroy', id: '123')
|
154
154
|
expect(notification_path(123)).to eq '/notifications/123'
|
155
155
|
end
|
156
|
-
it "
|
157
|
-
expect(
|
156
|
+
it "allows deleting all of them" do
|
157
|
+
expect(delete: '/notifications/delete_all').to route_to(controller: 'mailbox', action: 'delete_all')
|
158
158
|
expect(delete_all_notifications_path).to eq '/notifications/delete_all'
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
162
162
|
describe "Contact Form" do
|
163
|
-
it "
|
164
|
-
expect(
|
163
|
+
it "routes to new" do
|
164
|
+
expect(get: '/contact').to route_to(controller: 'contact_form', action: 'new')
|
165
165
|
end
|
166
166
|
|
167
|
-
it "
|
168
|
-
expect(
|
167
|
+
it "routes to create" do
|
168
|
+
expect(post: '/contact').to route_to(controller: 'contact_form', action: 'create')
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
172
|
describe "Dynamically edited pages" do
|
173
|
-
it "
|
174
|
-
expect(
|
173
|
+
it "routes to about" do
|
174
|
+
expect(get: '/about').to route_to(controller: 'pages', action: 'show', id: 'about_page')
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
178
|
describe "Static Pages" do
|
179
|
-
it "
|
180
|
-
expect(
|
179
|
+
it "routes to help" do
|
180
|
+
expect(get: '/help').to route_to(controller: 'static', action: 'help')
|
181
181
|
end
|
182
182
|
|
183
|
-
it "
|
184
|
-
expect(
|
183
|
+
it "routes to terms" do
|
184
|
+
expect(get: '/terms').to route_to(controller: 'static', action: 'terms')
|
185
185
|
end
|
186
186
|
|
187
|
-
it "
|
188
|
-
expect(
|
187
|
+
it "routes to zotero" do
|
188
|
+
expect(get: '/zotero').to route_to(controller: 'static', action: 'zotero')
|
189
189
|
end
|
190
190
|
|
191
|
-
it "
|
192
|
-
expect(
|
191
|
+
it "routes to mendeley" do
|
192
|
+
expect(get: '/mendeley').to route_to(controller: 'static', action: 'mendeley')
|
193
193
|
end
|
194
194
|
|
195
|
-
it "
|
196
|
-
expect(
|
195
|
+
it "routes to versions" do
|
196
|
+
expect(get: '/versions').to route_to(controller: 'static', action: 'versions')
|
197
197
|
end
|
198
198
|
|
199
|
-
it "
|
200
|
-
expect(
|
199
|
+
it "*not*s route a bogus static page" do
|
200
|
+
expect(get: '/awesome').not_to route_to(controller: 'static', action: 'awesome')
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
204
|
describe "Catch-all" do
|
205
|
-
it "
|
205
|
+
it "routes non-existent routes to errors" do
|
206
206
|
pending "The default route is turned off in testing, so that errors are raised"
|
207
|
-
expect(
|
207
|
+
expect(get: '/awesome').to route_to(controller: 'errors', action: 'routing', error: 'awesome')
|
208
208
|
end
|
209
209
|
end
|
210
210
|
end
|
@@ -8,7 +8,7 @@ describe Sufia::GenericFileAuditService do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
let(:service) {
|
11
|
+
let(:service) { described_class.new(f) }
|
12
12
|
|
13
13
|
describe "#audit" do
|
14
14
|
before do
|
@@ -47,17 +47,17 @@ describe Sufia::GenericFileAuditService do
|
|
47
47
|
|
48
48
|
describe "file loaded from fedora" do
|
49
49
|
context "when no audits have been run" do
|
50
|
-
it "
|
50
|
+
it "reports that audits have not been run" do
|
51
51
|
expect(subject).to eq "Audits have not yet been run on this file."
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
context "when no audit is passing" do
|
56
56
|
before do
|
57
|
-
|
57
|
+
ChecksumAuditLog.create!(pass: 1, generic_file_id: f.id, version: f.content.versions.first.label, dsid: 'content')
|
58
58
|
end
|
59
59
|
|
60
|
-
it "
|
60
|
+
it "reports that audit result" do
|
61
61
|
expect(subject).to eq 1
|
62
62
|
end
|
63
63
|
end
|
@@ -65,9 +65,9 @@ describe Sufia::GenericFileAuditService do
|
|
65
65
|
|
66
66
|
describe "file loaded from solr" do
|
67
67
|
let(:solr_file) { GenericFile.load_instance_from_solr(f.id) }
|
68
|
-
let(:service) {
|
68
|
+
let(:service) { described_class.new(solr_file) }
|
69
69
|
|
70
|
-
it "
|
70
|
+
it "does not audit by version" do
|
71
71
|
expect(service).not_to receive(:audit_stat_by_version)
|
72
72
|
expect(subject).to eq "Audits have not yet been run on this file."
|
73
73
|
end
|
@@ -77,7 +77,7 @@ describe Sufia::GenericFileAuditService do
|
|
77
77
|
ChecksumAuditLog.create!(pass: 1, generic_file_id: f.id, version: f.content.versions.first.label, dsid: 'content')
|
78
78
|
end
|
79
79
|
|
80
|
-
it "
|
80
|
+
it "reports that audit result" do
|
81
81
|
expect(service).not_to receive(:audit_stat_by_version)
|
82
82
|
expect(subject).to eq 1
|
83
83
|
end
|
@@ -89,7 +89,7 @@ describe Sufia::GenericFileAuditService do
|
|
89
89
|
ChecksumAuditLog.create!(pass: 1, generic_file_id: f.id, version: f.content.versions.first.label, dsid: 'content')
|
90
90
|
end
|
91
91
|
|
92
|
-
it "
|
92
|
+
it "reports that audit result" do
|
93
93
|
expect(service).not_to receive(:audit_stat_by_version)
|
94
94
|
expect(subject).to eq 0
|
95
95
|
end
|
@@ -10,9 +10,13 @@ describe Sufia::RepositoryAuditService do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "#audit_everything" do
|
13
|
-
it "
|
14
|
-
|
15
|
-
Sufia::
|
13
|
+
it "audits everything" do
|
14
|
+
# check that the method we are mocking still exists
|
15
|
+
expect(Sufia::GenericFileAuditService.new(nil)).to respond_to(:audit)
|
16
|
+
|
17
|
+
# make sure the audit gets called
|
18
|
+
expect_any_instance_of(Sufia::GenericFileAuditService).to receive(:audit)
|
19
|
+
described_class.audit_everything
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|