sufia 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Browse files", :
|
|
4
|
-
|
|
3
|
+
describe "Browse files", type: :feature do
|
|
5
4
|
before do
|
|
6
5
|
allow(User).to receive(:find_by_user_key).and_return(stub_model(User, twitter_handle: 'bob'))
|
|
7
6
|
end
|
|
@@ -25,14 +24,14 @@ describe "Browse files", :type => :feature do
|
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
describe "when not logged in" do
|
|
28
|
-
it "
|
|
27
|
+
it "lets us browse some of the fixtures" do
|
|
29
28
|
click_link "13"
|
|
30
29
|
expect(page).to have_content "Search Results"
|
|
31
30
|
click_link @fixtures[0].title[0]
|
|
32
31
|
expect(page).to have_content "Download"
|
|
33
32
|
expect(page).not_to have_content "Edit"
|
|
34
33
|
end
|
|
35
|
-
it "
|
|
34
|
+
it "allows you to click next" do
|
|
36
35
|
within('.bottom') do
|
|
37
36
|
click_link 'Next »'
|
|
38
37
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe 'catalog searching', :
|
|
4
|
-
|
|
3
|
+
describe 'catalog searching', type: :feature do
|
|
5
4
|
before do
|
|
6
5
|
@gf1 = GenericFile.new.tap do |f|
|
|
7
6
|
f.title = ['title 1']
|
|
@@ -36,7 +35,7 @@ describe 'catalog searching', :type => :feature do
|
|
|
36
35
|
end
|
|
37
36
|
end
|
|
38
37
|
|
|
39
|
-
# TODO most of these tests could be controller tests.
|
|
38
|
+
# TODO: most of these tests could be controller tests.
|
|
40
39
|
it "finds multiple files" do
|
|
41
40
|
within('#masthead_controls') do
|
|
42
41
|
fill_in('search-field-header', with: "tag2")
|
|
@@ -74,7 +73,7 @@ describe 'catalog searching', :type => :feature do
|
|
|
74
73
|
context "many tags" do
|
|
75
74
|
before do
|
|
76
75
|
(1..25).each do |i|
|
|
77
|
-
@gf1.tag += ["tag#{
|
|
76
|
+
@gf1.tag += ["tag#{format('%02d', i)}"]
|
|
78
77
|
end
|
|
79
78
|
@gf1.save!
|
|
80
79
|
within('#masthead_controls') do
|
|
@@ -92,6 +91,5 @@ describe 'catalog searching', :type => :feature do
|
|
|
92
91
|
expect(page).to have_content "Download"
|
|
93
92
|
expect(page).to_not have_content "Edit"
|
|
94
93
|
end
|
|
95
|
-
|
|
96
94
|
end
|
|
97
95
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Selecting files to import from cloud providers", :
|
|
3
|
+
describe "Selecting files to import from cloud providers", type: :feature do
|
|
4
4
|
before do
|
|
5
5
|
sign_in :user
|
|
6
6
|
click_link "Upload"
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
it "
|
|
9
|
+
it "has a Cloud file picker using browse-everything" do
|
|
10
10
|
click_link "Cloud Providers"
|
|
11
11
|
expect(page).to have_content "Browse cloud files"
|
|
12
12
|
expect(page).to have_content "Submit selected files"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe 'collection', :
|
|
3
|
+
describe 'collection', type: :feature do
|
|
4
4
|
def create_collection(title, description)
|
|
5
5
|
visit '/dashboard'
|
|
6
6
|
first('#hydra-collection-add').click
|
|
@@ -20,10 +20,10 @@ describe 'collection', :type => :feature do
|
|
|
20
20
|
expect(page).to have_content description
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
let(:title1) {"Test Collection 1"}
|
|
24
|
-
let(:description1) {"Description for collection 1 we are testing."}
|
|
25
|
-
let(:title2) {"Test Collection 2"}
|
|
26
|
-
let(:description2) {"Description for collection 2 we are testing."}
|
|
23
|
+
let(:title1) { "Test Collection 1" }
|
|
24
|
+
let(:description1) { "Description for collection 1 we are testing." }
|
|
25
|
+
let(:title2) { "Test Collection 2" }
|
|
26
|
+
let(:description2) { "Description for collection 2 we are testing." }
|
|
27
27
|
|
|
28
28
|
let(:user) { FactoryGirl.create(:user) }
|
|
29
29
|
|
|
@@ -47,7 +47,7 @@ describe 'collection', :type => :feature do
|
|
|
47
47
|
create_collection(title2, description2)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
it "
|
|
50
|
+
it "creates collection from the dashboard and include files", js: true do
|
|
51
51
|
visit '/dashboard/files'
|
|
52
52
|
first('input#check_all').click
|
|
53
53
|
click_button "Add to Collection" # opens the modal
|
|
@@ -63,7 +63,7 @@ describe 'collection', :type => :feature do
|
|
|
63
63
|
|
|
64
64
|
describe 'delete collection' do
|
|
65
65
|
let!(:collection) do
|
|
66
|
-
Collection.create(
|
|
66
|
+
Collection.create(title: 'collection title', description: 'collection description') do |c|
|
|
67
67
|
c.apply_depositor_metadata(user.user_key)
|
|
68
68
|
end
|
|
69
69
|
end
|
|
@@ -72,9 +72,9 @@ describe 'collection', :type => :feature do
|
|
|
72
72
|
visit '/dashboard/collections'
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
it "
|
|
75
|
+
it "deletes a collection" do
|
|
76
76
|
expect(page).to have_content(collection.title)
|
|
77
|
-
within('#document_'+collection.id) do
|
|
77
|
+
within('#document_' + collection.id) do
|
|
78
78
|
first('button.dropdown-toggle').click
|
|
79
79
|
first(".itemtrash").click
|
|
80
80
|
end
|
|
@@ -84,7 +84,7 @@ describe 'collection', :type => :feature do
|
|
|
84
84
|
|
|
85
85
|
describe 'show collection' do
|
|
86
86
|
let!(:collection) do
|
|
87
|
-
Collection.create(
|
|
87
|
+
Collection.create(title: 'collection title', description: 'collection description',
|
|
88
88
|
members: [gf1, gf2]) do |c|
|
|
89
89
|
c.apply_depositor_metadata(user.user_key)
|
|
90
90
|
end
|
|
@@ -94,9 +94,9 @@ describe 'collection', :type => :feature do
|
|
|
94
94
|
visit '/dashboard/collections'
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
it "
|
|
97
|
+
it "shows a collection with a listing of Descriptive Metadata and catalog-style search results" do
|
|
98
98
|
expect(page).to have_content(collection.title)
|
|
99
|
-
within('#document_'+collection.id) do
|
|
99
|
+
within('#document_' + collection.id) do
|
|
100
100
|
click_link("Display all details of collection title")
|
|
101
101
|
end
|
|
102
102
|
expect(page).to have_content(collection.title)
|
|
@@ -116,7 +116,7 @@ describe 'collection', :type => :feature do
|
|
|
116
116
|
expect(page).to have_content(gf2.title.first)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
it "
|
|
119
|
+
it "hides collection descriptive metadata when searching a collection" do
|
|
120
120
|
# URL: /dashboard/collections
|
|
121
121
|
expect(page).to have_content(collection.title)
|
|
122
122
|
within("#document_#{collection.id}") do
|
|
@@ -143,7 +143,7 @@ describe 'collection', :type => :feature do
|
|
|
143
143
|
describe 'edit collection' do
|
|
144
144
|
let!(:collection) do
|
|
145
145
|
Collection.create(title: 'collection title', description: 'collection description',
|
|
146
|
-
|
|
146
|
+
members: [gf1, gf2]) { |c| c.apply_depositor_metadata(user.user_key) }
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
before do
|
|
@@ -151,7 +151,7 @@ describe 'collection', :type => :feature do
|
|
|
151
151
|
visit '/dashboard/collections'
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
it "
|
|
154
|
+
it "edits and update collection metadata" do
|
|
155
155
|
# URL: /dashboard/collections
|
|
156
156
|
expect(page).to have_content(collection.title)
|
|
157
157
|
within("#document_#{collection.id}") do
|
|
@@ -179,7 +179,7 @@ describe 'collection', :type => :feature do
|
|
|
179
179
|
expect(page).to have_content(creators.first)
|
|
180
180
|
end
|
|
181
181
|
|
|
182
|
-
it "
|
|
182
|
+
it "removes a file from a collection" do
|
|
183
183
|
expect(page).to have_content(collection.title)
|
|
184
184
|
within("#document_#{collection.id}") do
|
|
185
185
|
first('button.dropdown-toggle').click
|
|
@@ -199,9 +199,9 @@ describe 'collection', :type => :feature do
|
|
|
199
199
|
expect(page).to have_content(gf2.title.first)
|
|
200
200
|
end
|
|
201
201
|
|
|
202
|
-
it "
|
|
202
|
+
it "removes all files from a collection", js: true do
|
|
203
203
|
expect(page).to have_content(collection.title)
|
|
204
|
-
within('#document_'+collection.id) do
|
|
204
|
+
within('#document_' + collection.id) do
|
|
205
205
|
first('button.dropdown-toggle').click
|
|
206
206
|
click_link('Edit Collection')
|
|
207
207
|
end
|
|
@@ -231,13 +231,13 @@ describe 'collection', :type => :feature do
|
|
|
231
231
|
|
|
232
232
|
let!(:collection) do
|
|
233
233
|
Collection.create(title: 'collection title', description: 'collection description',
|
|
234
|
-
|
|
234
|
+
members: gfs) { |c| c.apply_depositor_metadata(user.user_key) }
|
|
235
235
|
end
|
|
236
236
|
|
|
237
|
-
it "
|
|
237
|
+
it "shows a collection with a listing of Descriptive Metadata and catalog-style search results" do
|
|
238
238
|
visit '/dashboard/collections'
|
|
239
239
|
expect(page).to have_content(collection.title)
|
|
240
|
-
within('#document_'+collection.id) do
|
|
240
|
+
within('#document_' + collection.id) do
|
|
241
241
|
click_link("Display all details of collection title")
|
|
242
242
|
end
|
|
243
243
|
expect(page).to have_css(".pager")
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Sending an email via the contact form", :
|
|
4
|
-
|
|
3
|
+
describe "Sending an email via the contact form", type: :feature do
|
|
5
4
|
before do
|
|
6
5
|
sign_in :user_with_fixtures
|
|
7
6
|
end
|
|
8
7
|
|
|
9
|
-
it "
|
|
8
|
+
it "sends mail" do
|
|
10
9
|
allow_any_instance_of(ContactForm).to receive(:deliver).and_return(true)
|
|
11
10
|
visit '/'
|
|
12
11
|
click_link "Contact"
|
|
@@ -22,7 +21,7 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
22
21
|
allow_any_instance_of(ContactForm).to receive(:deliver).and_call_original
|
|
23
22
|
end
|
|
24
23
|
|
|
25
|
-
it "
|
|
24
|
+
it "gives an error when I don't provide a contact type" do
|
|
26
25
|
visit '/'
|
|
27
26
|
click_link "Contact"
|
|
28
27
|
expect(page).to have_content "Contact Form"
|
|
@@ -34,7 +33,7 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
34
33
|
expect(page).to have_content "Sorry, this message was not sent successfully"
|
|
35
34
|
end
|
|
36
35
|
|
|
37
|
-
it "
|
|
36
|
+
it "gives an error when I don't provide a valid email" do
|
|
38
37
|
visit '/'
|
|
39
38
|
click_link "Contact"
|
|
40
39
|
expect(page).to have_content "Contact Form"
|
|
@@ -47,7 +46,7 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
47
46
|
expect(page).to have_content "Sorry, this message was not sent successfully"
|
|
48
47
|
end
|
|
49
48
|
|
|
50
|
-
it "
|
|
49
|
+
it "gives an error when I don't provide a name" do
|
|
51
50
|
visit '/'
|
|
52
51
|
click_link "Contact"
|
|
53
52
|
expect(page).to have_content "Contact Form"
|
|
@@ -60,8 +59,8 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
context "when I don't provide a subject", :js do
|
|
63
|
-
it "
|
|
64
|
-
# TODO this should be a controller test, because that any_instance will be in a different thread
|
|
62
|
+
it "gives an error" do
|
|
63
|
+
# TODO: this should be a controller test, because that any_instance will be in a different thread
|
|
65
64
|
visit '/'
|
|
66
65
|
click_link "Contact"
|
|
67
66
|
expect(page).to have_content "Contact Form"
|
|
@@ -75,8 +74,8 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
75
74
|
end
|
|
76
75
|
|
|
77
76
|
context "when I don't provide a message", :js do
|
|
78
|
-
it "
|
|
79
|
-
# TODO this should be a controller test, because that any_instance will be in a different thread
|
|
77
|
+
it "gives an error" do
|
|
78
|
+
# TODO: this should be a controller test, because that any_instance will be in a different thread
|
|
80
79
|
visit '/'
|
|
81
80
|
click_link "Contact"
|
|
82
81
|
expect(page).to have_content "Contact Form"
|
|
@@ -89,7 +88,7 @@ describe "Sending an email via the contact form", :type => :feature do
|
|
|
89
88
|
end
|
|
90
89
|
end
|
|
91
90
|
|
|
92
|
-
it "
|
|
91
|
+
it "gives an error when I provide an invalid captcha" do
|
|
93
92
|
visit '/'
|
|
94
93
|
click_link "Contact"
|
|
95
94
|
expect(page).to have_content "Contact Form"
|
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "The Dashboard", :
|
|
4
|
-
|
|
3
|
+
describe "The Dashboard", type: :feature do
|
|
5
4
|
before do
|
|
6
5
|
sign_in :user_with_fixtures
|
|
7
6
|
end
|
|
8
7
|
|
|
9
8
|
context "upon sign-in" do
|
|
10
|
-
|
|
11
|
-
it "should show the user's information" do
|
|
9
|
+
it "shows the user's information" do
|
|
12
10
|
expect(page).to have_content "My Dashboard"
|
|
13
11
|
expect(page).to have_content "User Activity"
|
|
14
12
|
expect(page).to have_content "User Notifications"
|
|
15
13
|
expect(page).to have_content "Your Statistics"
|
|
16
14
|
end
|
|
17
15
|
|
|
18
|
-
it "
|
|
16
|
+
it "lets the user upload files" do
|
|
19
17
|
click_link "Upload"
|
|
20
18
|
expect(page).to have_content "Upload"
|
|
21
19
|
end
|
|
22
20
|
|
|
23
|
-
it "
|
|
21
|
+
it "lets the user create collections" do
|
|
24
22
|
click_link "Create Collection"
|
|
25
23
|
expect(page).to have_content "Create New Collection"
|
|
26
24
|
end
|
|
27
25
|
|
|
28
|
-
it "
|
|
26
|
+
it "lets the user view files" do
|
|
29
27
|
click_link "View Files"
|
|
30
28
|
expect(page).to have_content "My Files"
|
|
31
29
|
expect(page).to have_content "My Collections"
|
|
32
30
|
expect(page).to have_content "My Highlights"
|
|
33
31
|
expect(page).to have_content "Files Shared with Me"
|
|
34
32
|
end
|
|
35
|
-
|
|
36
33
|
end
|
|
37
|
-
|
|
38
34
|
end
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Editing a file:", :
|
|
3
|
+
describe "Editing a file:", type: :feature do
|
|
4
4
|
let(:user) { FactoryGirl.create(:user) }
|
|
5
5
|
let(:file_title) { 'Some kind of title' }
|
|
6
|
-
let(:file)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
let(:file) do
|
|
7
|
+
GenericFile.new.tap do |f|
|
|
8
|
+
f.title = [file_title]
|
|
9
|
+
f.apply_depositor_metadata(user.user_key)
|
|
10
|
+
f.save!
|
|
11
|
+
end
|
|
12
|
+
end
|
|
12
13
|
|
|
13
14
|
before { sign_in user }
|
|
14
15
|
|
|
15
16
|
context 'when the user tries to update file content, but forgets to select a file:' do
|
|
16
|
-
|
|
17
17
|
it 'displays an error' do
|
|
18
18
|
visit sufia.edit_generic_file_path(file)
|
|
19
19
|
click_link 'Versions'
|
|
@@ -21,6 +21,5 @@ describe "Editing a file:", :type => :feature do
|
|
|
21
21
|
expect(page).to have_content "Edit #{file_title}"
|
|
22
22
|
expect(page).to have_content 'Please select a file'
|
|
23
23
|
end
|
|
24
|
-
|
|
25
24
|
end
|
|
26
25
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Uploading files via web form", :
|
|
3
|
+
describe "Uploading files via web form", type: :feature do
|
|
4
4
|
before do
|
|
5
5
|
sign_in :user
|
|
6
6
|
click_link "Upload"
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
it "
|
|
9
|
+
it "has an ingest screen" do
|
|
10
10
|
expect(page).to have_content "Select files"
|
|
11
11
|
expect(page).to have_content "Start upload"
|
|
12
12
|
expect(page).to have_content "Cancel upload"
|
|
@@ -14,9 +14,9 @@ describe "Uploading files via web form", :type => :feature do
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
context "the terms of service", :js do
|
|
17
|
-
it "
|
|
18
|
-
attach_file("files[]", File.dirname(__FILE__)+"/../../spec/fixtures/image.jp2")
|
|
19
|
-
attach_file("files[]", File.dirname(__FILE__)+"/../../spec/fixtures/jp2_fits.xml")
|
|
17
|
+
it "is required to be checked" do
|
|
18
|
+
attach_file("files[]", File.dirname(__FILE__) + "/../../spec/fixtures/image.jp2")
|
|
19
|
+
attach_file("files[]", File.dirname(__FILE__) + "/../../spec/fixtures/jp2_fits.xml")
|
|
20
20
|
expect(page).to have_css("button#main_upload_start[disabled]")
|
|
21
21
|
find('#main_upload_start_span').hover
|
|
22
22
|
expect(page).to have_content "Please accept Deposit Agreement before you can upload."
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Notifications page", :
|
|
4
|
-
|
|
3
|
+
describe "Notifications page", type: :feature do
|
|
5
4
|
before do
|
|
6
5
|
sign_in FactoryGirl.create(:user_with_mail)
|
|
7
6
|
visit "/notifications"
|
|
8
7
|
end
|
|
9
8
|
|
|
10
|
-
it "
|
|
9
|
+
it "lists notifications with date, subject and message" do
|
|
11
10
|
expect(page).to have_content "User Notifications"
|
|
12
11
|
expect(page.find(:xpath, '//thead/tr')).to have_content "Date"
|
|
13
12
|
expect(page.find(:xpath, '//thead/tr')).to have_content "Subject"
|
|
@@ -19,7 +18,4 @@ describe "Notifications page", :type => :feature do
|
|
|
19
18
|
expect(page).to have_content "Batch upload permission denied "
|
|
20
19
|
expect(page).to have_content "Batch upload complete"
|
|
21
20
|
end
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
21
|
end
|
|
@@ -5,14 +5,14 @@ include Selectors::Dashboard
|
|
|
5
5
|
include Selectors::NewTransfers
|
|
6
6
|
include Selectors::Transfers
|
|
7
7
|
|
|
8
|
-
describe 'Transferring file ownership:', :
|
|
8
|
+
describe 'Transferring file ownership:', type: :feature do
|
|
9
9
|
let(:original_owner) { FactoryGirl.create(:archivist, display_name: 'Original Owner') }
|
|
10
10
|
let(:new_owner) { FactoryGirl.create(:jill, display_name: 'New Owner') }
|
|
11
11
|
let!(:file) do
|
|
12
12
|
GenericFile.new.tap do |f|
|
|
13
13
|
f.title = ['little_file.txt']
|
|
14
14
|
f.creator = ['little_file.txt_creator']
|
|
15
|
-
f.resource_type = ["stuff"
|
|
15
|
+
f.resource_type = ["stuff"]
|
|
16
16
|
f.read_groups = ['public']
|
|
17
17
|
f.apply_depositor_metadata(original_owner.user_key)
|
|
18
18
|
f.save!
|
data/spec/features/proxy_spec.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe 'proxy', :
|
|
3
|
+
describe 'proxy', type: :feature do
|
|
4
4
|
let(:user) { FactoryGirl.find_or_create(:archivist) }
|
|
5
5
|
let(:second_user) { FactoryGirl.find_or_create(:jill) }
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ describe 'proxy', :type => :feature do
|
|
|
33
33
|
end
|
|
34
34
|
select(second_user.user_key, from: 'on_behalf_of')
|
|
35
35
|
test_file_path = File.expand_path('../../fixtures/small_file.txt', __FILE__)
|
|
36
|
-
page.execute_script(%
|
|
36
|
+
page.execute_script(%{$("input[type=file]").first().css("opacity", "1").css("-moz-transform", "none");$("input[type=file]").first().attr('id',"fileselect");})
|
|
37
37
|
attach_file("fileselect", test_file_path)
|
|
38
38
|
click_button('Start upload')
|
|
39
39
|
expect(page).to have_content('Apply Metadata')
|