sufia 6.2.0 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +146 -0
  3. data/.travis.yml +4 -7
  4. data/Gemfile +2 -0
  5. data/History.md +29 -1
  6. data/README.md +25 -9
  7. data/SUFIA_VERSION +1 -1
  8. data/app/assets/stylesheets/sufia/_collections.scss +15 -0
  9. data/app/assets/stylesheets/sufia/_file-listing.scss +7 -0
  10. data/app/assets/stylesheets/sufia/_home-page.scss +10 -0
  11. data/app/builders/sufia/bootstrap_breadcrumbs_builder.rb +3 -5
  12. data/app/controllers/admin/stats_controller.rb +1 -76
  13. data/app/controllers/api/items_controller.rb +4 -6
  14. data/app/controllers/api/zotero_controller.rb +5 -5
  15. data/app/controllers/authorities_controller.rb +5 -1
  16. data/app/controllers/batch_edits_controller.rb +3 -3
  17. data/app/controllers/concerns/sufia/admin/depositor_stats.rb +41 -0
  18. data/app/controllers/concerns/sufia/admin/stats_behavior.rb +94 -0
  19. data/app/controllers/concerns/sufia/batch_controller_behavior.rb +16 -18
  20. data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +54 -56
  21. data/app/controllers/concerns/sufia/breadcrumbs.rb +3 -6
  22. data/app/controllers/concerns/sufia/collections_controller_behavior.rb +39 -39
  23. data/app/controllers/concerns/sufia/controller.rb +10 -10
  24. data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +17 -18
  25. data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +9 -12
  26. data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +6 -7
  27. data/app/controllers/concerns/sufia/files_controller/local_ingest_behavior.rb +39 -40
  28. data/app/controllers/concerns/sufia/files_controller/upload_complete_behavior.rb +1 -1
  29. data/app/controllers/concerns/sufia/files_controller_behavior.rb +109 -110
  30. data/app/controllers/concerns/sufia/homepage_controller.rb +8 -8
  31. data/app/controllers/concerns/sufia/my_controller_behavior.rb +13 -10
  32. data/app/controllers/concerns/sufia/single_use_links_controller_behavior.rb +11 -14
  33. data/app/controllers/concerns/sufia/single_use_links_viewer_controller_behavior.rb +27 -21
  34. data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +17 -17
  35. data/app/controllers/concerns/sufia/users_controller_behavior.rb +54 -54
  36. data/app/controllers/contact_form_controller.rb +1 -1
  37. data/app/controllers/content_blocks_controller.rb +11 -12
  38. data/app/controllers/directory_controller.rb +2 -3
  39. data/app/controllers/featured_work_lists_controller.rb +1 -1
  40. data/app/controllers/featured_works_controller.rb +2 -4
  41. data/app/controllers/homepage_controller.rb +1 -2
  42. data/app/controllers/mailbox_controller.rb +12 -32
  43. data/app/controllers/my/collections_controller.rb +3 -4
  44. data/app/controllers/my/files_controller.rb +4 -6
  45. data/app/controllers/my/highlights_controller.rb +4 -6
  46. data/app/controllers/my/shares_controller.rb +3 -5
  47. data/app/controllers/pages_controller.rb +1 -3
  48. data/app/controllers/single_use_links_controller.rb +0 -1
  49. data/app/controllers/single_use_links_viewer_controller.rb +0 -1
  50. data/app/controllers/static_controller.rb +1 -0
  51. data/app/forms/sufia/forms/collection_edit_form.rb +2 -2
  52. data/app/helpers/batch_edits_helper.rb +1 -3
  53. data/app/helpers/content_block_helper.rb +7 -8
  54. data/app/helpers/generic_file_helper.rb +23 -24
  55. data/app/helpers/sufia/blacklight_override.rb +6 -7
  56. data/app/helpers/sufia/dashboard_helper_behavior.rb +4 -7
  57. data/app/helpers/sufia/permissions_helper.rb +3 -4
  58. data/app/helpers/sufia/sufia_helper_behavior.rb +30 -29
  59. data/app/helpers/trophy_helper.rb +15 -15
  60. data/app/inputs/select_with_modal_help_input.rb +3 -3
  61. data/app/inputs/with_help_icon.rb +4 -4
  62. data/app/jobs/content_delete_event_job.rb +0 -1
  63. data/app/jobs/content_depositor_change_event_job.rb +1 -2
  64. data/app/jobs/event_job.rb +0 -1
  65. data/app/jobs/user_unfollow_event_job.rb +1 -0
  66. data/app/models/concerns/sufia/solr_document_behavior.rb +1 -2
  67. data/app/models/contact_form.rb +6 -6
  68. data/app/models/content_block.rb +1 -2
  69. data/app/models/featured_work_list.rb +3 -5
  70. data/app/models/user_mailbox.rb +44 -0
  71. data/app/presenters/sufia/collection_presenter.rb +6 -8
  72. data/app/presenters/sufia/generic_file_presenter.rb +2 -2
  73. data/app/presenters/sufia/presenter_renderer.rb +2 -2
  74. data/app/presenters/sufia/version_list_presenter.rb +1 -1
  75. data/app/presenters/sufia/version_presenter.rb +3 -6
  76. data/app/search_builders/deposit_search_builder.rb +19 -0
  77. data/app/search_builders/sufia/my_search_builder_behavior.rb +1 -2
  78. data/app/search_builders/sufia/search_builder.rb +1 -3
  79. data/app/uploaders/tinymce_asset_uploader.rb +0 -2
  80. data/app/views/_controls.html.erb +5 -5
  81. data/app/views/admin/stats/_deposits.html.erb +19 -0
  82. data/app/views/admin/stats/index.html.erb +2 -0
  83. data/app/views/batch_edits/edit.html.erb +2 -2
  84. data/app/views/collections/_edit_actions.html.erb +3 -3
  85. data/app/views/collections/_form_for_select_collection.html.erb +2 -2
  86. data/app/views/collections/_sort_and_per_page.html.erb +12 -9
  87. data/app/views/collections/_view_type_group.html.erb +1 -1
  88. data/app/views/collections/edit.html.erb +5 -5
  89. data/app/views/collections/show.html.erb +7 -6
  90. data/app/views/homepage/_announcement.html.erb +5 -0
  91. data/app/views/homepage/_home.html.erb +1 -0
  92. data/app/views/my/_sort_and_per_page.html.erb +14 -10
  93. data/app/views/my/index.html.erb +1 -1
  94. data/app/views/pages/show.html.erb +0 -2
  95. data/app/views/single_use_links/new_download.html.erb +1 -1
  96. data/app/views/single_use_links_viewer/show.html.erb +1 -1
  97. data/app/views/users/_notify_link.html.erb +1 -1
  98. data/app/views/users/_notify_number.html.erb +2 -2
  99. data/config/initializers/simple_form.rb +1 -1
  100. data/config/initializers/simple_form_bootstrap.rb +1 -1
  101. data/config/locales/sufia.en.yml +4 -0
  102. data/config/routes.rb +2 -3
  103. data/lib/generators/sufia/admin_stat_generator.rb +0 -3
  104. data/lib/generators/sufia/install_generator.rb +8 -9
  105. data/lib/generators/sufia/templates/catalog_controller.rb +2 -3
  106. data/lib/generators/sufia/templates/config/action_dispatch_http_upload_monkey_patch.rb +1 -0
  107. data/lib/generators/sufia/upgrade400_generator.rb +9 -9
  108. data/lib/generators/sufia/upgrade600_generator.rb +1 -4
  109. data/lib/sufia.rb +2 -2
  110. data/lib/sufia/arkivo/actor.rb +1 -1
  111. data/lib/sufia/arkivo/create_subscription_job.rb +30 -30
  112. data/lib/sufia/arkivo/metadata_munger.rb +7 -7
  113. data/lib/sufia/arkivo/schema_validator.rb +1 -1
  114. data/lib/sufia/single_use_error.rb +0 -1
  115. data/lib/sufia/version.rb +1 -1
  116. data/lib/sufia/zotero/config.rb +13 -13
  117. data/spec/actors/generic_file/actor_spec.rb +17 -18
  118. data/spec/controllers/admin_stats_controller_spec.rb +56 -5
  119. data/spec/controllers/api/zotero_controller_spec.rb +10 -9
  120. data/spec/controllers/authorities_controller_spec.rb +8 -8
  121. data/spec/controllers/batch_controller_spec.rb +19 -20
  122. data/spec/controllers/batch_edits_controller_spec.rb +8 -9
  123. data/spec/controllers/catalog_controller_spec.rb +7 -9
  124. data/spec/controllers/collections_controller_spec.rb +30 -32
  125. data/spec/controllers/content_blocks_controller_spec.rb +4 -4
  126. data/spec/controllers/dashboard_controller_spec.rb +12 -12
  127. data/spec/controllers/depositors_controller_spec.rb +8 -8
  128. data/spec/controllers/downloads_controller_spec.rb +10 -11
  129. data/spec/controllers/featured_work_lists_controller_spec.rb +4 -4
  130. data/spec/controllers/featured_works_controller_spec.rb +11 -12
  131. data/spec/controllers/generic_files_controller_spec.rb +154 -125
  132. data/spec/controllers/homepage_controller_spec.rb +22 -15
  133. data/spec/controllers/mailbox_controller_spec.rb +20 -36
  134. data/spec/controllers/my/collections_controller_spec.rb +4 -5
  135. data/spec/controllers/my/files_controller_spec.rb +10 -11
  136. data/spec/controllers/my/highlights_controller_spec.rb +4 -5
  137. data/spec/controllers/my/shares_controller_spec.rb +12 -14
  138. data/spec/controllers/my_controller_spec.rb +1 -3
  139. data/spec/controllers/pages_controller_spec.rb +4 -4
  140. data/spec/controllers/single_use_links_controller_spec.rb +1 -3
  141. data/spec/controllers/single_use_links_viewer_controller_spec.rb +1 -2
  142. data/spec/controllers/static_controller_spec.rb +1 -1
  143. data/spec/controllers/tinymce_assets_controller_spec.rb +8 -9
  144. data/spec/controllers/transfers_controller_spec.rb +19 -19
  145. data/spec/controllers/users_controller_spec.rb +33 -35
  146. data/spec/factories/api_items.rb +2 -2
  147. data/spec/factories/content_blocks.rb +1 -1
  148. data/spec/factories/featured_works.rb +1 -1
  149. data/spec/factories/generic_files.rb +3 -3
  150. data/spec/factories/users.rb +7 -8
  151. data/spec/features/browse_dashboard_files_spec.rb +14 -18
  152. data/spec/features/browse_files_spec.rb +3 -4
  153. data/spec/features/catalog_search_spec.rb +3 -5
  154. data/spec/features/cloud_upload_spec.rb +2 -2
  155. data/spec/features/collection_spec.rb +21 -21
  156. data/spec/features/contact_form_spec.rb +10 -11
  157. data/spec/features/display_dashboard_spec.rb +5 -9
  158. data/spec/features/edit_file_spec.rb +8 -9
  159. data/spec/features/featured_item_spec.rb +1 -1
  160. data/spec/features/ingest_upload_files_spec.rb +5 -5
  161. data/spec/features/notifications_spec.rb +2 -6
  162. data/spec/features/ownership_transfer_spec.rb +2 -2
  163. data/spec/features/proxy_spec.rb +2 -2
  164. data/spec/features/search_spec.rb +3 -4
  165. data/spec/features/single_use_links_spec.rb +1 -1
  166. data/spec/features/users_spec.rb +4 -5
  167. data/spec/forms/collection_edit_form_spec.rb +2 -2
  168. data/spec/forms/generic_file_edit_form_spec.rb +6 -7
  169. data/spec/helpers/batch_edits_helper_spec.rb +9 -13
  170. data/spec/helpers/content_block_helper_spec.rb +3 -3
  171. data/spec/helpers/dashboard_helper_spec.rb +19 -24
  172. data/spec/helpers/generic_file_helper_spec.rb +5 -7
  173. data/spec/helpers/sufia_helper_spec.rb +43 -54
  174. data/spec/helpers/trophy_helper_spec.rb +5 -5
  175. data/spec/inputs/multi_value_with_help_input_spec.rb +1 -2
  176. data/spec/inputs/select_with_help_input_spec.rb +19 -15
  177. data/spec/javascripts/jasmine_spec.rb +4 -5
  178. data/spec/javascripts/support/jasmine_helper.rb +9 -9
  179. data/spec/jobs/active_fedora_id_based_job_spec.rb +7 -5
  180. data/spec/jobs/audit_job_spec.rb +7 -7
  181. data/spec/jobs/batch_update_job_spec.rb +5 -6
  182. data/spec/jobs/characterize_job_spec.rb +1 -1
  183. data/spec/jobs/content_depositor_change_event_job_spec.rb +1 -1
  184. data/spec/jobs/create_derivatives_job_spec.rb +5 -5
  185. data/spec/jobs/event_jobs_spec.rb +16 -16
  186. data/spec/jobs/import_url_job_spec.rb +36 -5
  187. data/spec/jobs/ingest_local_file_job_spec.rb +31 -20
  188. data/spec/jobs/sufia_resque_queue_spec.rb +1 -1
  189. data/spec/lib/sufia/analytics_spec.rb +0 -1
  190. data/spec/lib/sufia/arkivo/actor_spec.rb +6 -6
  191. data/spec/lib/sufia/arkivo/schema_validator_spec.rb +18 -18
  192. data/spec/lib/sufia/breadcrumbs_spec.rb +5 -6
  193. data/spec/lib/sufia/messages_spec.rb +11 -12
  194. data/spec/lib/sufia/readable_permissions_spec.rb +8 -10
  195. data/spec/lib/sufia/upload_complete_behavior_spec.rb +6 -7
  196. data/spec/lib/sufia/user_stat_importer_spec.rb +30 -33
  197. data/spec/lib/sufia/writable_permissions_spec.rb +1 -3
  198. data/spec/lib/sufia/zotero/config_spec.rb +4 -6
  199. data/spec/models/ability_spec.rb +11 -9
  200. data/spec/models/batch_spec.rb +13 -13
  201. data/spec/models/characterization_spec.rb +2 -3
  202. data/spec/models/checksum_audit_log_spec.rb +18 -19
  203. data/spec/models/collection_spec.rb +11 -12
  204. data/spec/models/content_block_spec.rb +33 -22
  205. data/spec/models/download_spec.rb +3 -5
  206. data/spec/models/featured_work_list_spec.rb +3 -3
  207. data/spec/models/featured_work_spec.rb +12 -14
  208. data/spec/models/file_content_datastream_spec.rb +9 -7
  209. data/spec/models/file_download_stat_spec.rb +34 -40
  210. data/spec/models/file_usage_spec.rb +46 -52
  211. data/spec/models/file_view_stat_spec.rb +35 -41
  212. data/spec/models/fits_datastream_spec.rb +23 -25
  213. data/spec/models/generic_file/visibility_spec.rb +10 -5
  214. data/spec/models/generic_file_spec.rb +86 -88
  215. data/spec/models/geo_names_resource_spec.rb +3 -5
  216. data/spec/models/local_authority_spec.rb +30 -33
  217. data/spec/models/pageview_spec.rb +3 -3
  218. data/spec/models/proxy_deposit_request_spec.rb +3 -3
  219. data/spec/models/single_use_link_spec.rb +36 -36
  220. data/spec/models/solr_document_spec.rb +3 -6
  221. data/spec/models/trophy_spec.rb +8 -9
  222. data/spec/models/user_mailbox_spec.rb +62 -0
  223. data/spec/models/user_spec.rb +28 -29
  224. data/spec/presenters/presenter_renderer_spec.rb +1 -1
  225. data/spec/presenters/sufia/generic_file_presenter_spec.rb +5 -5
  226. data/spec/presenters/sufia/version_list_presenter_spec.rb +2 -2
  227. data/spec/presenters/sufia/version_presenter_spec.rb +1 -1
  228. data/spec/routing/featured_works_route_spec.rb +4 -4
  229. data/spec/routing/ownership_transfers_route_spec.rb +1 -1
  230. data/spec/routing/route_spec.rb +89 -89
  231. data/spec/services/generic_file_audit_service_spec.rb +8 -8
  232. data/spec/services/repository_audit_service_spec.rb +7 -3
  233. data/spec/spec_helper.rb +5 -4
  234. data/spec/support/features/session_helpers.rb +1 -1
  235. data/spec/support/input_support.rb +1 -2
  236. data/spec/support/rake.rb +1 -1
  237. data/spec/support/selectors.rb +1 -6
  238. data/spec/support/statistic_helper.rb +1 -1
  239. data/spec/support/uploaded_file_monkeypatch.rb +1 -1
  240. data/spec/tasks/rake_spec.rb +3 -5
  241. data/spec/views/admin/stats/index.html.erb_spec.rb +16 -16
  242. data/spec/views/batch/edit.html.erb_spec.rb +1 -3
  243. data/spec/views/batch_edits/check_all_spec.rb +5 -5
  244. data/spec/views/batch_edits/edit.html.erb_spec.rb +1 -3
  245. data/spec/views/catalog/index.html.erb_spec.rb +1 -3
  246. data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +4 -5
  247. data/spec/views/collections/_form.html.erb_spec.rb +5 -3
  248. data/spec/views/collections/_show_descriptions.html.erb_spec.rb +7 -8
  249. data/spec/views/collections/_show_document_list.erb_spec.rb +4 -6
  250. data/spec/views/dashboard/index_spec.rb +14 -21
  251. data/spec/views/generic_file/_browse_everything.html.erb_spec.rb +2 -2
  252. data/spec/views/generic_file/_permission_form.html.erb_spec.rb +8 -9
  253. data/spec/views/generic_file/edit.html.erb_spec.rb +7 -7
  254. data/spec/views/generic_file/show.html.erb_spec.rb +24 -25
  255. data/spec/views/generic_file/stats.html.erb_spec.rb +19 -19
  256. data/spec/views/homepage/_announcement.html.erb_spec.rb +51 -0
  257. data/spec/views/homepage/_featured_works.html.erb_spec.rb +5 -9
  258. data/spec/views/homepage/_home_header.html.erb_spec.rb +2 -2
  259. data/spec/views/my/facet.html.erb_spec.rb +4 -4
  260. data/spec/views/single_use_links/new_download.html.erb_spec.rb +28 -0
  261. data/spec/views/single_use_links_viewer/show.html.erb_spec.rb +29 -0
  262. data/spec/views/users/_follower_modal.html.erb_spec.rb +7 -8
  263. data/spec/views/users/_following_modal.html.erb_spec.rb +4 -5
  264. data/spec/views/users/_notify_number.html.erb_spec.rb +2 -5
  265. data/spec/views/users/_user_util_links.html.erb_spec.rb +5 -8
  266. data/spec/views/users/index.html.erb_spec.rb +4 -6
  267. data/spec/views/users/show.html.erb_spec.rb +4 -7
  268. data/tasks/sufia-dev.rake +19 -3
  269. metadata +20 -5
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Browse files", :type => :feature do
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 "should let us browse some of the fixtures" do
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 "should allow you to click next" do
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', :type => :feature do
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#{sprintf('%02d', i)}"]
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", :type => :feature do
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 "should have a Cloud file picker using browse-everything" do
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', :type => :feature 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
@@ -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 "should create collection from the dashboard and include files", js: true do
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( title: 'collection title', description: 'collection description') do |c|
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 "should delete a collection" do
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( title: 'collection title', description: 'collection description',
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 "should show a collection with a listing of Descriptive Metadata and catalog-style search results" do
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 "should hide collection descriptive metadata when searching a collection" do
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
- members: [gf1, gf2]) { |c| c.apply_depositor_metadata(user.user_key) }
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 "should edit and update collection metadata" do
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 "should remove a file from a collection" do
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 "should remove all files from a collection", js: true do
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
- members: gfs) { |c| c.apply_depositor_metadata(user.user_key) }
234
+ members: gfs) { |c| c.apply_depositor_metadata(user.user_key) }
235
235
  end
236
236
 
237
- it "should show a collection with a listing of Descriptive Metadata and catalog-style search results" do
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", :type => :feature do
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 "should send mail" do
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 "should give an error when I don't provide a contact type" do
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 "should give an error when I don't provide a valid email" do
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 "should give an error when I don't provide a name" do
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 "should give an error" do
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 "should give an error" do
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 "should give an error when I provide an invalid captcha" do
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", :type => :feature do
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 "should let the user upload files" do
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 "should let the user create collections" do
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 "should let the user view files" do
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:", :type => :feature do
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) { GenericFile.new.tap do |f|
7
- f.title = [file_title]
8
- f.apply_depositor_metadata(user.user_key)
9
- f.save!
10
- end
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
@@ -8,7 +8,7 @@ describe "featuring items" do
8
8
  u.save
9
9
  u
10
10
  end
11
- it "should have a working unfeature link", :js => true do
11
+ it "has a working unfeature link", js: true do
12
12
  sign_in user
13
13
  file = create(:public_file)
14
14
  create(:featured_work, generic_file_id: file.id)
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Uploading files via web form", :type => :feature do
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 "should have an ingest screen" do
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 "should be 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")
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", :type => :feature do
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 "should list notifications with date, subject and message" do
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:', :type => :feature do
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!
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'proxy', :type => :feature do
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(%Q{$("input[type=file]").first().css("opacity", "1").css("-moz-transform", "none");$("input[type=file]").first().attr('id',"fileselect");})
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')