sufia 4.0.1 → 4.1.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/History.md +247 -215
- data/README.md +7 -3
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/sufia.js +5 -2
- data/app/assets/javascripts/sufia/proxy_rights.js +68 -0
- data/app/assets/javascripts/sufia/transfers.js +3 -0
- data/app/assets/javascripts/sufia/user_search.js +31 -0
- data/app/assets/stylesheets/jquery-ui.css +17 -17
- data/app/assets/stylesheets/sufia.css.scss +3 -2
- data/app/assets/stylesheets/sufia/_proxy-rights.scss +10 -0
- data/app/controllers/concerns/sufia/contact_form_controller_behavior.rb +22 -23
- data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +41 -0
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +1 -0
- data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +76 -0
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +9 -11
- data/app/controllers/depositors_controller.rb +3 -0
- data/app/controllers/transfers_controller.rb +3 -0
- data/app/helpers/sufia/dashboard_helper_behavior.rb +15 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +24 -2
- data/app/jobs/content_depositor_change_event_job.rb +50 -0
- data/app/views/dashboard/_index_partials/_contents.html.erb +18 -0
- data/app/views/dashboard/_index_partials/_proxy_rights.html.erb +23 -0
- data/app/views/dashboard/_index_partials/_transfers.html.erb +14 -0
- data/app/views/generic_files/proxy.html.erb +5 -0
- data/app/views/generic_files/upload/_form.html.erb +7 -2
- data/app/views/my/_action_menu.html.erb +3 -1
- data/app/views/records/edit_fields/_default.html.erb +1 -1
- data/app/views/transfers/_received.html.erb +58 -0
- data/app/views/transfers/_sent.html.erb +38 -0
- data/app/views/transfers/index.html.erb +7 -0
- data/app/views/transfers/new.html.erb +23 -0
- data/app/views/users/_proxies.html.erb +8 -0
- data/app/views/users/_user_util_links_extra.html.erb +1 -0
- data/app/views/users/edit.html.erb +6 -1
- data/config/locales/sufia.en.yml +9 -4
- data/config/routes.rb +14 -3
- data/lib/sufia.rb +7 -5
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/authorities_controller_spec.rb +6 -6
- data/spec/controllers/batch_controller_spec.rb +29 -29
- data/spec/controllers/batch_edits_controller_spec.rb +7 -7
- data/spec/controllers/catalog_controller_spec.rb +9 -9
- data/spec/controllers/collections_controller_spec.rb +28 -28
- data/spec/controllers/content_blocks_controller_spec.rb +3 -3
- data/spec/controllers/dashboard_controller_spec.rb +1 -1
- data/spec/controllers/depositors_controller_spec.rb +50 -0
- data/spec/controllers/downloads_controller_spec.rb +22 -22
- data/spec/controllers/featured_work_lists_controller_spec.rb +1 -1
- data/spec/controllers/featured_works_controller_spec.rb +1 -1
- data/spec/controllers/generic_files_controller_spec.rb +98 -90
- data/spec/controllers/homepage_controller_spec.rb +1 -1
- data/spec/controllers/mailbox_controller_spec.rb +10 -10
- data/spec/controllers/my/collections_controller_spec.rb +1 -1
- data/spec/controllers/my/files_controller_spec.rb +1 -1
- data/spec/controllers/my/highlights_controller_spec.rb +1 -1
- data/spec/controllers/my/shares_controller_spec.rb +1 -1
- data/spec/controllers/my_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +1 -1
- data/spec/controllers/single_use_links_controller_spec.rb +46 -50
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +16 -16
- data/spec/controllers/static_controller_spec.rb +9 -9
- data/spec/controllers/tinymce_assets_controller_spec.rb +1 -1
- data/spec/controllers/transfers_controller_spec.rb +212 -0
- data/spec/controllers/users_controller_spec.rb +1 -1
- data/spec/factories/generic_files.rb +4 -4
- data/spec/factories/proxy_deposit_requests.rb +6 -0
- data/spec/features/browse_dashboard_files_spec.rb +25 -36
- data/spec/features/browse_files_spec.rb +18 -13
- data/spec/features/catalog_search_spec.rb +3 -6
- data/spec/features/cloud_upload_spec.rb +5 -7
- data/spec/features/collection_spec.rb +28 -35
- data/spec/features/contact_form_spec.rb +24 -24
- data/spec/features/display_dashboard_spec.rb +11 -11
- data/spec/features/ingest_upload_files_spec.rb +10 -10
- data/spec/features/notifications_spec.rb +11 -11
- data/spec/features/ownership_transfer_spec.rb +111 -0
- data/spec/features/proxy_spec.rb +52 -0
- data/spec/features/search_spec.rb +1 -1
- data/spec/features/single_use_links_spec.rb +28 -18
- data/spec/features/users_spec.rb +3 -3
- data/spec/helpers/batch_edits_helper_spec.rb +1 -1
- data/spec/helpers/content_block_helper_spec.rb +1 -1
- data/spec/helpers/dashboard_helper_spec.rb +1 -1
- data/spec/helpers/generic_file_helper_spec.rb +1 -1
- data/spec/helpers/records_helper_spec.rb +1 -1
- data/spec/helpers/sufia_helper_spec.rb +8 -8
- data/spec/helpers/trophy_helper_spec.rb +1 -1
- data/spec/jobs/audit_job_spec.rb +5 -5
- data/spec/jobs/batch_update_job_spec.rb +14 -14
- data/spec/jobs/content_depositor_change_event_job_spec.rb +22 -0
- data/spec/jobs/event_jobs_spec.rb +104 -104
- data/spec/jobs/import_url_job_spec.rb +2 -2
- data/spec/jobs/ingest_local_file_job_spec.rb +1 -1
- data/spec/lib/sufia/breadcrumbs_spec.rb +3 -3
- data/spec/lib/sufia/id_service_spec.rb +1 -1
- data/spec/lib/sufia/upload_complete_behavior_spec.rb +4 -4
- data/spec/models/ability_spec.rb +59 -15
- data/spec/models/batch_spec.rb +16 -16
- data/spec/models/characterization_spec.rb +1 -1
- data/spec/models/checksum_audit_log_spec.rb +34 -26
- data/spec/models/collection_spec.rb +1 -1
- data/spec/models/download_spec.rb +1 -1
- data/spec/models/featured_work_list_spec.rb +1 -1
- data/spec/models/featured_work_spec.rb +15 -4
- data/spec/models/file_content_datastream_spec.rb +14 -14
- data/spec/models/file_usage_spec.rb +1 -1
- data/spec/models/fits_datastream_spec.rb +1 -1
- data/spec/models/generic_file/reload_on_save_spec.rb +4 -4
- data/spec/models/generic_file/visibility_spec.rb +1 -1
- data/spec/models/generic_file/web_form_spec.rb +6 -5
- data/spec/models/generic_file_rdf_datastream_spec.rb +1 -1
- data/spec/models/generic_file_spec.rb +254 -220
- data/spec/models/geo_names_resource_spec.rb +2 -2
- data/spec/models/local_authority_spec.rb +60 -59
- data/spec/models/pageview_spec.rb +1 -1
- data/spec/models/properties_datastream_spec.rb +29 -10
- data/spec/models/proxy_deposit_request_spec.rb +107 -0
- data/spec/models/single_use_link_spec.rb +13 -13
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/models/trophy_spec.rb +6 -6
- data/spec/models/user_spec.rb +38 -22
- data/spec/routing/featured_works_route_spec.rb +1 -1
- data/spec/routing/ownership_transfers_route_spec.rb +45 -0
- data/spec/routing/route_spec.rb +42 -42
- data/spec/services/noid_spec.rb +2 -2
- data/spec/spec_helper.rb +10 -5
- data/spec/support/cleaner.rb +12 -0
- data/spec/support/features.rb +5 -0
- data/spec/support/features/session_helpers.rb +3 -17
- data/spec/support/locations.rb +36 -0
- data/spec/support/poltergeist.rb +11 -0
- data/spec/support/proxies.rb +14 -0
- data/spec/support/selectors.rb +122 -0
- data/spec/views/batch/edit.html.erb_spec.rb +1 -1
- data/spec/views/batch_edits/check_all_spec.rb +4 -4
- data/spec/views/catalog/index.html.erb_spec.rb +1 -1
- data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +1 -1
- data/spec/views/collections/_form.html.erb_spec.rb +3 -1
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +1 -1
- data/spec/views/dashboard/index_spec.rb +3 -6
- data/spec/views/generic_file/edit.html.erb_spec.rb +1 -1
- data/spec/views/generic_file/show.html.erb_spec.rb +1 -1
- data/spec/views/generic_file/stats.html.erb_spec.rb +1 -1
- data/spec/views/my/facet.html.erb_spec.rb +2 -2
- data/spec/views/users/_follower_modal.html.erb_spec.rb +1 -1
- data/spec/views/users/_following_modal.html.erb_spec.rb +1 -1
- data/spec/views/users/_notify_number.html.erb_spec.rb +1 -1
- data/spec/views/users/_user_util_links.html.erb_spec.rb +1 -1
- data/spec/views/users/index.html.erb_spec.rb +2 -2
- data/spec/views/users/show.html.erb_spec.rb +2 -2
- data/sufia-models/app/models/concerns/sufia/ability.rb +22 -0
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +1 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/proxy_deposit.rb +22 -0
- data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +3 -0
- data/sufia-models/app/models/concerns/sufia/user.rb +9 -0
- data/sufia-models/app/models/proxy_deposit_request.rb +85 -0
- data/sufia-models/app/models/proxy_deposit_rights.rb +4 -0
- data/sufia-models/app/models/sufia/avatar_uploader.rb +2 -3
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +9 -1
- data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +53 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_requests.rb +16 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_rights.rb +11 -0
- data/sufia-models/lib/sufia/models/engine.rb +1 -1
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia.gemspec +2 -1
- data/tasks/sufia-dev.rake +5 -0
- metadata +82 -6
- data/tasks/sufia-db.rake +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
FactoryGirl.define do
|
|
2
2
|
factory :generic_file do
|
|
3
|
-
|
|
3
|
+
transient do
|
|
4
4
|
depositor "archivist1@example.com"
|
|
5
5
|
end
|
|
6
6
|
before(:create) do |gf, evaluator|
|
|
@@ -13,7 +13,7 @@ FactoryGirl.define do
|
|
|
13
13
|
|
|
14
14
|
factory :fixture do
|
|
15
15
|
factory :public_pdf do
|
|
16
|
-
|
|
16
|
+
transient do
|
|
17
17
|
pid "sufia:fixture-pdf"
|
|
18
18
|
end
|
|
19
19
|
initialize_with { new(pid: pid) }
|
|
@@ -27,7 +27,7 @@ FactoryGirl.define do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
factory :public_mp3 do
|
|
30
|
-
|
|
30
|
+
transient do
|
|
31
31
|
pid "sufia:fixture-mp3"
|
|
32
32
|
end
|
|
33
33
|
initialize_with { new(pid: pid) }
|
|
@@ -40,7 +40,7 @@ FactoryGirl.define do
|
|
|
40
40
|
read_groups ["public"]
|
|
41
41
|
end
|
|
42
42
|
factory :public_wav do
|
|
43
|
-
|
|
43
|
+
transient do
|
|
44
44
|
pid "sufia:fixture-wav"
|
|
45
45
|
end
|
|
46
46
|
initialize_with { new(pid: pid) }
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Browse Dashboard" do
|
|
3
|
+
describe "Browse Dashboard", :type => :feature do
|
|
4
4
|
|
|
5
|
-
before do
|
|
5
|
+
before :all do
|
|
6
|
+
cleanup_jetty
|
|
6
7
|
@fixtures = find_or_create_file_fixtures
|
|
8
|
+
end
|
|
9
|
+
after :all do
|
|
10
|
+
cleanup_jetty
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
before do
|
|
7
14
|
sign_in FactoryGirl.create :user_with_fixtures
|
|
8
15
|
end
|
|
9
16
|
|
|
@@ -17,10 +24,13 @@ describe "Browse Dashboard" do
|
|
|
17
24
|
context "within my files page" do
|
|
18
25
|
|
|
19
26
|
before do
|
|
20
|
-
visit "dashboard/files"
|
|
27
|
+
visit "/dashboard/files"
|
|
21
28
|
end
|
|
22
29
|
|
|
23
30
|
it "should display all the necessary information" do
|
|
31
|
+
within("#document_#{@fixtures.first.noid}") do
|
|
32
|
+
click_button("Select an action")
|
|
33
|
+
end
|
|
24
34
|
expect(page).to have_content("Edit File")
|
|
25
35
|
expect(page).to have_content("Download File")
|
|
26
36
|
expect(page).to_not have_content("Is part of:")
|
|
@@ -44,6 +54,7 @@ describe "Browse Dashboard" do
|
|
|
44
54
|
end
|
|
45
55
|
|
|
46
56
|
it "should allow you to browse facets" do
|
|
57
|
+
click_link "Subject"
|
|
47
58
|
click_link "more Subjects"
|
|
48
59
|
click_link "consectetur"
|
|
49
60
|
within("#document_#{@fixtures[1].noid}") do
|
|
@@ -62,50 +73,28 @@ describe "Browse Dashboard" do
|
|
|
62
73
|
|
|
63
74
|
it "should refresh the page of files" do
|
|
64
75
|
click_button "Refresh"
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
within("#document_#{@fixtures.first.noid}") do
|
|
77
|
+
click_button("Select an action")
|
|
78
|
+
expect(page).to have_content("Edit File")
|
|
79
|
+
expect(page).to have_content("Download File")
|
|
80
|
+
end
|
|
67
81
|
end
|
|
68
82
|
|
|
69
83
|
it "should allow me to edit files in batches" do
|
|
70
|
-
pending "Need to enable javascript testing"
|
|
71
84
|
first('input#check_all').click
|
|
72
85
|
click_button('Edit Selected')
|
|
73
86
|
expect(page).to have_content('3 files')
|
|
74
87
|
end
|
|
75
88
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
it "should search within my collections" do
|
|
83
|
-
within(".input-group-btn") do
|
|
84
|
-
expect(page).to have_content("My Collections")
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
context "within my highlights page" do
|
|
90
|
-
before do
|
|
91
|
-
visit "dashboard/highlights"
|
|
92
|
-
end
|
|
93
|
-
it "should search within my highlights" do
|
|
94
|
-
within(".input-group-btn") do
|
|
95
|
-
expect(page).to have_content("My Highlights")
|
|
89
|
+
it "should link to my other tabs" do
|
|
90
|
+
["My Collections", "My Highlights", "Files Shared with Me"].each do |tab|
|
|
91
|
+
within("#my_nav") do
|
|
92
|
+
click_link(tab)
|
|
93
|
+
end
|
|
94
|
+
expect(page).to have_content(tab)
|
|
96
95
|
end
|
|
97
96
|
end
|
|
98
|
-
end
|
|
99
97
|
|
|
100
|
-
context "within my shares page" do
|
|
101
|
-
before do
|
|
102
|
-
visit "dashboard/shares"
|
|
103
|
-
end
|
|
104
|
-
it "should search within my shares" do
|
|
105
|
-
within(".input-group-btn") do
|
|
106
|
-
expect(page).to have_content("My Shares")
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
98
|
end
|
|
110
99
|
|
|
111
100
|
end
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Browse files" do
|
|
3
|
+
describe "Browse files", :type => :feature do
|
|
4
4
|
|
|
5
|
-
before do
|
|
6
|
-
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
before(:all) do
|
|
5
|
+
before :all do
|
|
6
|
+
cleanup_jetty
|
|
10
7
|
@fixtures = find_or_create_file_fixtures
|
|
11
8
|
@fixtures[0].tag = ["key"]
|
|
12
9
|
(1..25).each do |i|
|
|
@@ -15,25 +12,33 @@ describe "Browse files" do
|
|
|
15
12
|
@fixtures[0].save
|
|
16
13
|
end
|
|
17
14
|
|
|
15
|
+
after :all do
|
|
16
|
+
cleanup_jetty
|
|
17
|
+
end
|
|
18
|
+
|
|
18
19
|
before do
|
|
20
|
+
allow(User).to receive(:find_by_user_key).and_return(stub_model(User, twitter_handle: 'bob'))
|
|
19
21
|
visit '/'
|
|
20
22
|
fill_in "search-field-header", with: "key"
|
|
21
23
|
click_button "search-submit-header"
|
|
22
|
-
click_link "
|
|
24
|
+
click_link "Keyword"
|
|
25
|
+
click_link "more Keywords»"
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
describe "when not logged in" do
|
|
26
29
|
it "should let us browse some of the fixtures" do
|
|
27
30
|
click_link "18"
|
|
28
|
-
page.
|
|
31
|
+
expect(page).to have_content "Search Results"
|
|
29
32
|
click_link @fixtures[0].title[0]
|
|
30
|
-
page.
|
|
31
|
-
page.
|
|
33
|
+
expect(page).to have_content "Download"
|
|
34
|
+
expect(page).not_to have_content "Edit"
|
|
32
35
|
end
|
|
33
36
|
it "should allow you to click next" do
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
click_link 'Next »'
|
|
38
|
+
within(".modal-body") do
|
|
39
|
+
expect(page).to have_content "5"
|
|
40
|
+
expect(page).not_to have_content "11"
|
|
41
|
+
end
|
|
37
42
|
end
|
|
38
43
|
end
|
|
39
44
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe 'catalog searching' do
|
|
3
|
+
describe 'catalog searching', :type => :feature do
|
|
4
4
|
|
|
5
5
|
before(:all) do
|
|
6
6
|
@gf1 = GenericFile.new.tap do |f|
|
|
@@ -84,11 +84,8 @@ describe 'catalog searching' do
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
it "allows for browsing tags" do
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
first('a.more_facets_link').click
|
|
90
|
-
click_link "more Keywords»"
|
|
91
|
-
end
|
|
87
|
+
click_link "Keyword"
|
|
88
|
+
click_link "more Keywords»"
|
|
92
89
|
click_link "tag18"
|
|
93
90
|
expect(page).to have_content "Search Results"
|
|
94
91
|
click_link @gf1.title[0]
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Selecting files to import from cloud providers" do
|
|
4
|
-
|
|
3
|
+
describe "Selecting files to import from cloud providers", :type => :feature do
|
|
5
4
|
before do
|
|
6
5
|
sign_in :user
|
|
6
|
+
click_link "Upload"
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "should have a Cloud file picker using browse-everything" do
|
|
10
|
-
click_link "upload"
|
|
11
10
|
click_link "Cloud Providers"
|
|
12
|
-
page.
|
|
13
|
-
page.
|
|
14
|
-
page.
|
|
11
|
+
expect(page).to have_content "Browse cloud files"
|
|
12
|
+
expect(page).to have_content "Submit selected files"
|
|
13
|
+
expect(page).to have_content "0 items selected"
|
|
15
14
|
click_button 'Browse cloud files'
|
|
16
15
|
end
|
|
17
|
-
|
|
18
16
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe 'collection' do
|
|
3
|
+
describe 'collection', :type => :feature do
|
|
4
4
|
def create_collection(title, description)
|
|
5
5
|
visit '/dashboard'
|
|
6
6
|
first('#hydra-collection-add').click
|
|
@@ -19,12 +19,8 @@ describe 'collection' do
|
|
|
19
19
|
let(:description2) {"Description for collection 2 we are testing."}
|
|
20
20
|
|
|
21
21
|
let(:user) { FactoryGirl.find_or_create(:archivist) }
|
|
22
|
-
let(:user_key) { user.user_key }
|
|
23
22
|
|
|
24
23
|
before(:all) do
|
|
25
|
-
@old_resque_inline_value = Resque.inline
|
|
26
|
-
Resque.inline = true
|
|
27
|
-
|
|
28
24
|
@gfs = []
|
|
29
25
|
(0..12).each do |x|
|
|
30
26
|
@gfs[x] = GenericFile.new.tap do |f|
|
|
@@ -38,10 +34,7 @@ describe 'collection' do
|
|
|
38
34
|
end
|
|
39
35
|
|
|
40
36
|
after(:all) do
|
|
41
|
-
|
|
42
|
-
Batch.destroy_all
|
|
43
|
-
GenericFile.destroy_all
|
|
44
|
-
Collection.destroy_all
|
|
37
|
+
ActiveFedora::Base.destroy_all
|
|
45
38
|
end
|
|
46
39
|
|
|
47
40
|
describe 'create collection' do
|
|
@@ -67,19 +60,19 @@ describe 'collection' do
|
|
|
67
60
|
before (:each) do
|
|
68
61
|
@collection = Collection.new title:'collection title'
|
|
69
62
|
@collection.description = 'collection description'
|
|
70
|
-
@collection.apply_depositor_metadata(user_key)
|
|
63
|
+
@collection.apply_depositor_metadata(user.user_key)
|
|
71
64
|
@collection.save
|
|
72
65
|
sign_in user
|
|
73
66
|
visit '/dashboard/collections'
|
|
74
67
|
end
|
|
75
68
|
|
|
76
69
|
it "should delete a collection" do
|
|
77
|
-
page.
|
|
70
|
+
expect(page).to have_content(@collection.title)
|
|
78
71
|
within('#document_'+@collection.noid) do
|
|
79
72
|
first('button.dropdown-toggle').click
|
|
80
73
|
first(".itemtrash").click
|
|
81
74
|
end
|
|
82
|
-
page.
|
|
75
|
+
expect(page).not_to have_content(@collection.title)
|
|
83
76
|
end
|
|
84
77
|
end
|
|
85
78
|
|
|
@@ -87,7 +80,7 @@ describe 'collection' do
|
|
|
87
80
|
before do
|
|
88
81
|
@collection = Collection.new title: 'collection title'
|
|
89
82
|
@collection.description = 'collection description'
|
|
90
|
-
@collection.apply_depositor_metadata(user_key)
|
|
83
|
+
@collection.apply_depositor_metadata(user.user_key)
|
|
91
84
|
@collection.members = [@gf1,@gf2]
|
|
92
85
|
@collection.save
|
|
93
86
|
sign_in user
|
|
@@ -144,7 +137,7 @@ describe 'collection' do
|
|
|
144
137
|
before (:each) do
|
|
145
138
|
@collection = Collection.new(title: 'collection title')
|
|
146
139
|
@collection.description = 'collection description'
|
|
147
|
-
@collection.apply_depositor_metadata(user_key)
|
|
140
|
+
@collection.apply_depositor_metadata(user.user_key)
|
|
148
141
|
@collection.members = [@gf1, @gf2]
|
|
149
142
|
@collection.save
|
|
150
143
|
sign_in user
|
|
@@ -180,41 +173,41 @@ describe 'collection' do
|
|
|
180
173
|
end
|
|
181
174
|
|
|
182
175
|
it "should remove a file from a collection" do
|
|
183
|
-
page.
|
|
176
|
+
expect(page).to have_content(@collection.title)
|
|
184
177
|
within("#document_#{@collection.noid}") do
|
|
185
178
|
first('button.dropdown-toggle').click
|
|
186
179
|
click_link('Edit Collection')
|
|
187
180
|
end
|
|
188
|
-
page.
|
|
189
|
-
page.
|
|
190
|
-
page.
|
|
191
|
-
page.
|
|
181
|
+
expect(page).to have_field('collection_title', with: @collection.title)
|
|
182
|
+
expect(page).to have_field('collection_description', with: @collection.description)
|
|
183
|
+
expect(page).to have_content(@gf1.title.first)
|
|
184
|
+
expect(page).to have_content(@gf2.title.first)
|
|
192
185
|
within("#document_#{@gf1.noid}") do
|
|
193
186
|
first('button.dropdown-toggle').click
|
|
194
187
|
click_button('Remove from Collection')
|
|
195
188
|
end
|
|
196
|
-
page.
|
|
197
|
-
page.
|
|
198
|
-
page.
|
|
199
|
-
page.
|
|
189
|
+
expect(page).to have_content(@collection.title)
|
|
190
|
+
expect(page).to have_content(@collection.description)
|
|
191
|
+
expect(page).not_to have_content(@gf1.title.first)
|
|
192
|
+
expect(page).to have_content(@gf2.title.first)
|
|
200
193
|
end
|
|
201
194
|
|
|
202
195
|
it "should remove all files from a collection", js: true do
|
|
203
|
-
page.
|
|
196
|
+
expect(page).to have_content(@collection.title)
|
|
204
197
|
within('#document_'+@collection.noid) do
|
|
205
198
|
first('button.dropdown-toggle').click
|
|
206
199
|
click_link('Edit Collection')
|
|
207
200
|
end
|
|
208
|
-
page.
|
|
209
|
-
page.
|
|
210
|
-
page.
|
|
211
|
-
page.
|
|
201
|
+
expect(page).to have_field('collection_title', with: @collection.title)
|
|
202
|
+
expect(page).to have_field('collection_description', with: @collection.description)
|
|
203
|
+
expect(page).to have_content(@gf1.title.first)
|
|
204
|
+
expect(page).to have_content(@gf2.title.first)
|
|
212
205
|
first('input#check_all').click
|
|
213
206
|
click_button('Remove From Collection')
|
|
214
|
-
page.
|
|
215
|
-
page.
|
|
216
|
-
page.
|
|
217
|
-
page.
|
|
207
|
+
expect(page).to have_content(@collection.title)
|
|
208
|
+
expect(page).to have_content(@collection.description)
|
|
209
|
+
expect(page).not_to have_content(@gf1.title.first)
|
|
210
|
+
expect(page).not_to have_content(@gf2.title.first)
|
|
218
211
|
end
|
|
219
212
|
end
|
|
220
213
|
|
|
@@ -222,7 +215,7 @@ describe 'collection' do
|
|
|
222
215
|
before (:each) do
|
|
223
216
|
@collection = Collection.new title:'collection title'
|
|
224
217
|
@collection.description = 'collection description'
|
|
225
|
-
@collection.apply_depositor_metadata(user_key)
|
|
218
|
+
@collection.apply_depositor_metadata(user.user_key)
|
|
226
219
|
@collection.members = @gfs
|
|
227
220
|
@collection.save!
|
|
228
221
|
sign_in user
|
|
@@ -230,11 +223,11 @@ describe 'collection' do
|
|
|
230
223
|
end
|
|
231
224
|
|
|
232
225
|
it "should show a collection with a listing of Descriptive Metadata and catalog-style search results" do
|
|
233
|
-
page.
|
|
226
|
+
expect(page).to have_content(@collection.title)
|
|
234
227
|
within('#document_'+@collection.noid) do
|
|
235
228
|
click_link("Display all details of collection title")
|
|
236
229
|
end
|
|
237
|
-
page.
|
|
230
|
+
expect(page).to have_css(".pager")
|
|
238
231
|
end
|
|
239
232
|
end
|
|
240
233
|
end
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe "Sending an email via the contact form" do
|
|
3
|
+
describe "Sending an email via the contact form", :type => :feature do
|
|
4
4
|
|
|
5
5
|
before do
|
|
6
6
|
sign_in :user_with_fixtures
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "should send mail" do
|
|
10
|
-
ContactForm.
|
|
10
|
+
allow_any_instance_of(ContactForm).to receive(:deliver).and_return(true)
|
|
11
11
|
visit '/'
|
|
12
12
|
click_link "Contact"
|
|
13
|
-
page.
|
|
14
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
13
|
+
expect(page).to have_content "Contact Form"
|
|
14
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
15
15
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
16
16
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
17
17
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
18
18
|
select "Depositing content", from: "contact_form_category"
|
|
19
19
|
click_button "Send"
|
|
20
|
-
page.
|
|
20
|
+
expect(page).to have_content "Thank you"
|
|
21
21
|
# this step allows the delivery to go back to normal
|
|
22
|
-
ContactForm.
|
|
22
|
+
allow_any_instance_of(ContactForm).to receive(:deliver).and_call_original
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "should give an error when I don't provide a contact type" do
|
|
26
26
|
visit '/'
|
|
27
27
|
click_link "Contact"
|
|
28
|
-
page.
|
|
29
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
28
|
+
expect(page).to have_content "Contact Form"
|
|
29
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
30
30
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
31
31
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
32
32
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
33
33
|
click_button "Send"
|
|
34
|
-
page.
|
|
34
|
+
expect(page).to have_content "Sorry, this message was not sent successfully"
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it "should give an error when I don't provide a valid email" do
|
|
38
38
|
visit '/'
|
|
39
39
|
click_link "Contact"
|
|
40
|
-
page.
|
|
41
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
40
|
+
expect(page).to have_content "Contact Form"
|
|
41
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
42
42
|
fill_in "contact_form_email", with: "archivist1"
|
|
43
43
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
44
44
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
45
45
|
select "Depositing content", from: "contact_form_category"
|
|
46
46
|
click_button "Send"
|
|
47
|
-
page.
|
|
47
|
+
expect(page).to have_content "Sorry, this message was not sent successfully"
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
it "should give an error when I don't provide a name" do
|
|
51
51
|
visit '/'
|
|
52
52
|
click_link "Contact"
|
|
53
|
-
page.
|
|
53
|
+
expect(page).to have_content "Contact Form"
|
|
54
54
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
55
55
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
56
56
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
57
57
|
select "Depositing content", from: "contact_form_category"
|
|
58
58
|
click_button "Send"
|
|
59
|
-
page.
|
|
59
|
+
expect(page).to have_content "Sorry, this message was not delivered"
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
it "should give an error when I don't provide a subject" do
|
|
63
63
|
visit '/'
|
|
64
64
|
click_link "Contact"
|
|
65
|
-
page.
|
|
66
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
65
|
+
expect(page).to have_content "Contact Form"
|
|
66
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
67
67
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
68
68
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
69
69
|
select "Depositing content", from: "contact_form_category"
|
|
70
|
+
expect_any_instance_of(ContactForm).not_to receive(:deliver)
|
|
70
71
|
click_button "Send"
|
|
71
|
-
page.should have_content "Sorry, this message was not sent successfully"
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
it "should give an error when I don't provide a message" do
|
|
75
75
|
visit '/'
|
|
76
76
|
click_link "Contact"
|
|
77
|
-
page.
|
|
78
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
77
|
+
expect(page).to have_content "Contact Form"
|
|
78
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
79
79
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
80
80
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
81
81
|
select "Depositing content", from: "contact_form_category"
|
|
82
|
+
expect_any_instance_of(ContactForm).not_to receive(:deliver)
|
|
82
83
|
click_button "Send"
|
|
83
|
-
page.should have_content "Sorry, this message was not sent successfully"
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
it "should give an error when I provide an invalid captcha" do
|
|
87
87
|
visit '/'
|
|
88
88
|
click_link "Contact"
|
|
89
|
-
page.
|
|
90
|
-
fill_in
|
|
91
|
-
fill_in "contact_form_name", with: "Test McPherson"
|
|
89
|
+
expect(page).to have_content "Contact Form"
|
|
90
|
+
fill_in 'contact_form_contact_method', with: 'My name is', visible: false
|
|
91
|
+
fill_in "contact_form_name", with: "Test McPherson"
|
|
92
92
|
fill_in "contact_form_email", with: "archivist1@example.com"
|
|
93
93
|
fill_in "contact_form_subject", with: "My Subject is Cool"
|
|
94
94
|
fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
|
|
95
95
|
select "Depositing content", from: "contact_form_category"
|
|
96
96
|
click_button "Send"
|
|
97
|
-
page.
|
|
97
|
+
expect(page).to have_content "Sorry, this message was not sent successfully"
|
|
98
98
|
end
|
|
99
99
|
end
|