sufia 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +247 -215
  3. data/README.md +7 -3
  4. data/SUFIA_VERSION +1 -1
  5. data/app/assets/javascripts/sufia.js +5 -2
  6. data/app/assets/javascripts/sufia/proxy_rights.js +68 -0
  7. data/app/assets/javascripts/sufia/transfers.js +3 -0
  8. data/app/assets/javascripts/sufia/user_search.js +31 -0
  9. data/app/assets/stylesheets/jquery-ui.css +17 -17
  10. data/app/assets/stylesheets/sufia.css.scss +3 -2
  11. data/app/assets/stylesheets/sufia/_proxy-rights.scss +10 -0
  12. data/app/controllers/concerns/sufia/contact_form_controller_behavior.rb +22 -23
  13. data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +41 -0
  14. data/app/controllers/concerns/sufia/files_controller_behavior.rb +1 -0
  15. data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +76 -0
  16. data/app/controllers/concerns/sufia/users_controller_behavior.rb +9 -11
  17. data/app/controllers/depositors_controller.rb +3 -0
  18. data/app/controllers/transfers_controller.rb +3 -0
  19. data/app/helpers/sufia/dashboard_helper_behavior.rb +15 -0
  20. data/app/helpers/sufia/sufia_helper_behavior.rb +24 -2
  21. data/app/jobs/content_depositor_change_event_job.rb +50 -0
  22. data/app/views/dashboard/_index_partials/_contents.html.erb +18 -0
  23. data/app/views/dashboard/_index_partials/_proxy_rights.html.erb +23 -0
  24. data/app/views/dashboard/_index_partials/_transfers.html.erb +14 -0
  25. data/app/views/generic_files/proxy.html.erb +5 -0
  26. data/app/views/generic_files/upload/_form.html.erb +7 -2
  27. data/app/views/my/_action_menu.html.erb +3 -1
  28. data/app/views/records/edit_fields/_default.html.erb +1 -1
  29. data/app/views/transfers/_received.html.erb +58 -0
  30. data/app/views/transfers/_sent.html.erb +38 -0
  31. data/app/views/transfers/index.html.erb +7 -0
  32. data/app/views/transfers/new.html.erb +23 -0
  33. data/app/views/users/_proxies.html.erb +8 -0
  34. data/app/views/users/_user_util_links_extra.html.erb +1 -0
  35. data/app/views/users/edit.html.erb +6 -1
  36. data/config/locales/sufia.en.yml +9 -4
  37. data/config/routes.rb +14 -3
  38. data/lib/sufia.rb +7 -5
  39. data/lib/sufia/version.rb +1 -1
  40. data/spec/controllers/authorities_controller_spec.rb +6 -6
  41. data/spec/controllers/batch_controller_spec.rb +29 -29
  42. data/spec/controllers/batch_edits_controller_spec.rb +7 -7
  43. data/spec/controllers/catalog_controller_spec.rb +9 -9
  44. data/spec/controllers/collections_controller_spec.rb +28 -28
  45. data/spec/controllers/content_blocks_controller_spec.rb +3 -3
  46. data/spec/controllers/dashboard_controller_spec.rb +1 -1
  47. data/spec/controllers/depositors_controller_spec.rb +50 -0
  48. data/spec/controllers/downloads_controller_spec.rb +22 -22
  49. data/spec/controllers/featured_work_lists_controller_spec.rb +1 -1
  50. data/spec/controllers/featured_works_controller_spec.rb +1 -1
  51. data/spec/controllers/generic_files_controller_spec.rb +98 -90
  52. data/spec/controllers/homepage_controller_spec.rb +1 -1
  53. data/spec/controllers/mailbox_controller_spec.rb +10 -10
  54. data/spec/controllers/my/collections_controller_spec.rb +1 -1
  55. data/spec/controllers/my/files_controller_spec.rb +1 -1
  56. data/spec/controllers/my/highlights_controller_spec.rb +1 -1
  57. data/spec/controllers/my/shares_controller_spec.rb +1 -1
  58. data/spec/controllers/my_controller_spec.rb +1 -1
  59. data/spec/controllers/pages_controller_spec.rb +1 -1
  60. data/spec/controllers/single_use_links_controller_spec.rb +46 -50
  61. data/spec/controllers/single_use_links_viewer_controller_spec.rb +16 -16
  62. data/spec/controllers/static_controller_spec.rb +9 -9
  63. data/spec/controllers/tinymce_assets_controller_spec.rb +1 -1
  64. data/spec/controllers/transfers_controller_spec.rb +212 -0
  65. data/spec/controllers/users_controller_spec.rb +1 -1
  66. data/spec/factories/generic_files.rb +4 -4
  67. data/spec/factories/proxy_deposit_requests.rb +6 -0
  68. data/spec/features/browse_dashboard_files_spec.rb +25 -36
  69. data/spec/features/browse_files_spec.rb +18 -13
  70. data/spec/features/catalog_search_spec.rb +3 -6
  71. data/spec/features/cloud_upload_spec.rb +5 -7
  72. data/spec/features/collection_spec.rb +28 -35
  73. data/spec/features/contact_form_spec.rb +24 -24
  74. data/spec/features/display_dashboard_spec.rb +11 -11
  75. data/spec/features/ingest_upload_files_spec.rb +10 -10
  76. data/spec/features/notifications_spec.rb +11 -11
  77. data/spec/features/ownership_transfer_spec.rb +111 -0
  78. data/spec/features/proxy_spec.rb +52 -0
  79. data/spec/features/search_spec.rb +1 -1
  80. data/spec/features/single_use_links_spec.rb +28 -18
  81. data/spec/features/users_spec.rb +3 -3
  82. data/spec/helpers/batch_edits_helper_spec.rb +1 -1
  83. data/spec/helpers/content_block_helper_spec.rb +1 -1
  84. data/spec/helpers/dashboard_helper_spec.rb +1 -1
  85. data/spec/helpers/generic_file_helper_spec.rb +1 -1
  86. data/spec/helpers/records_helper_spec.rb +1 -1
  87. data/spec/helpers/sufia_helper_spec.rb +8 -8
  88. data/spec/helpers/trophy_helper_spec.rb +1 -1
  89. data/spec/jobs/audit_job_spec.rb +5 -5
  90. data/spec/jobs/batch_update_job_spec.rb +14 -14
  91. data/spec/jobs/content_depositor_change_event_job_spec.rb +22 -0
  92. data/spec/jobs/event_jobs_spec.rb +104 -104
  93. data/spec/jobs/import_url_job_spec.rb +2 -2
  94. data/spec/jobs/ingest_local_file_job_spec.rb +1 -1
  95. data/spec/lib/sufia/breadcrumbs_spec.rb +3 -3
  96. data/spec/lib/sufia/id_service_spec.rb +1 -1
  97. data/spec/lib/sufia/upload_complete_behavior_spec.rb +4 -4
  98. data/spec/models/ability_spec.rb +59 -15
  99. data/spec/models/batch_spec.rb +16 -16
  100. data/spec/models/characterization_spec.rb +1 -1
  101. data/spec/models/checksum_audit_log_spec.rb +34 -26
  102. data/spec/models/collection_spec.rb +1 -1
  103. data/spec/models/download_spec.rb +1 -1
  104. data/spec/models/featured_work_list_spec.rb +1 -1
  105. data/spec/models/featured_work_spec.rb +15 -4
  106. data/spec/models/file_content_datastream_spec.rb +14 -14
  107. data/spec/models/file_usage_spec.rb +1 -1
  108. data/spec/models/fits_datastream_spec.rb +1 -1
  109. data/spec/models/generic_file/reload_on_save_spec.rb +4 -4
  110. data/spec/models/generic_file/visibility_spec.rb +1 -1
  111. data/spec/models/generic_file/web_form_spec.rb +6 -5
  112. data/spec/models/generic_file_rdf_datastream_spec.rb +1 -1
  113. data/spec/models/generic_file_spec.rb +254 -220
  114. data/spec/models/geo_names_resource_spec.rb +2 -2
  115. data/spec/models/local_authority_spec.rb +60 -59
  116. data/spec/models/pageview_spec.rb +1 -1
  117. data/spec/models/properties_datastream_spec.rb +29 -10
  118. data/spec/models/proxy_deposit_request_spec.rb +107 -0
  119. data/spec/models/single_use_link_spec.rb +13 -13
  120. data/spec/models/solr_document_spec.rb +1 -1
  121. data/spec/models/trophy_spec.rb +6 -6
  122. data/spec/models/user_spec.rb +38 -22
  123. data/spec/routing/featured_works_route_spec.rb +1 -1
  124. data/spec/routing/ownership_transfers_route_spec.rb +45 -0
  125. data/spec/routing/route_spec.rb +42 -42
  126. data/spec/services/noid_spec.rb +2 -2
  127. data/spec/spec_helper.rb +10 -5
  128. data/spec/support/cleaner.rb +12 -0
  129. data/spec/support/features.rb +5 -0
  130. data/spec/support/features/session_helpers.rb +3 -17
  131. data/spec/support/locations.rb +36 -0
  132. data/spec/support/poltergeist.rb +11 -0
  133. data/spec/support/proxies.rb +14 -0
  134. data/spec/support/selectors.rb +122 -0
  135. data/spec/views/batch/edit.html.erb_spec.rb +1 -1
  136. data/spec/views/batch_edits/check_all_spec.rb +4 -4
  137. data/spec/views/catalog/index.html.erb_spec.rb +1 -1
  138. data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +1 -1
  139. data/spec/views/collections/_form.html.erb_spec.rb +3 -1
  140. data/spec/views/collections/_show_descriptions.html.erb_spec.rb +1 -1
  141. data/spec/views/dashboard/index_spec.rb +3 -6
  142. data/spec/views/generic_file/edit.html.erb_spec.rb +1 -1
  143. data/spec/views/generic_file/show.html.erb_spec.rb +1 -1
  144. data/spec/views/generic_file/stats.html.erb_spec.rb +1 -1
  145. data/spec/views/my/facet.html.erb_spec.rb +2 -2
  146. data/spec/views/users/_follower_modal.html.erb_spec.rb +1 -1
  147. data/spec/views/users/_following_modal.html.erb_spec.rb +1 -1
  148. data/spec/views/users/_notify_number.html.erb_spec.rb +1 -1
  149. data/spec/views/users/_user_util_links.html.erb_spec.rb +1 -1
  150. data/spec/views/users/index.html.erb_spec.rb +2 -2
  151. data/spec/views/users/show.html.erb_spec.rb +2 -2
  152. data/sufia-models/app/models/concerns/sufia/ability.rb +22 -0
  153. data/sufia-models/app/models/concerns/sufia/generic_file.rb +1 -0
  154. data/sufia-models/app/models/concerns/sufia/generic_file/proxy_deposit.rb +22 -0
  155. data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +3 -0
  156. data/sufia-models/app/models/concerns/sufia/user.rb +9 -0
  157. data/sufia-models/app/models/proxy_deposit_request.rb +85 -0
  158. data/sufia-models/app/models/proxy_deposit_rights.rb +4 -0
  159. data/sufia-models/app/models/sufia/avatar_uploader.rb +2 -3
  160. data/sufia-models/lib/generators/sufia/models/install_generator.rb +9 -1
  161. data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +53 -0
  162. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_requests.rb +16 -0
  163. data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_rights.rb +11 -0
  164. data/sufia-models/lib/sufia/models/engine.rb +1 -1
  165. data/sufia-models/lib/sufia/models/version.rb +1 -1
  166. data/sufia.gemspec +2 -1
  167. data/tasks/sufia-dev.rake +5 -0
  168. metadata +82 -6
  169. data/tasks/sufia-db.rake +0 -21
@@ -0,0 +1,12 @@
1
+ module CleanerHelper
2
+ # Removes any data in Fedora and Solr
3
+ def cleanup_jetty
4
+ ActiveFedora::Base.delete_all
5
+ Blacklight.solr.delete_by_query("*:*")
6
+ Blacklight.solr.commit
7
+ end
8
+
9
+ RSpec.configure do |config|
10
+ config.include CleanerHelper
11
+ end
12
+ end
@@ -1,6 +1,11 @@
1
1
  # spec/support/features.rb
2
2
  require File.expand_path('../features/session_helpers', __FILE__)
3
3
  require File.expand_path('../fixture_helpers', __FILE__)
4
+ require File.expand_path('../selectors', __FILE__)
5
+ require File.expand_path('../proxies', __FILE__)
6
+ require File.expand_path('../locations', __FILE__)
7
+ require File.expand_path('../poltergeist', __FILE__)
8
+ require File.expand_path('../cleaner', __FILE__)
4
9
 
5
10
  RSpec.configure do |config|
6
11
  config.include Features::SessionHelpers, type: :feature
@@ -1,28 +1,14 @@
1
1
  # spec/support/features/session_helpers.rb
2
2
  module Features
3
3
  module SessionHelpers
4
- def sign_up_with(email, password)
5
- Capybara.exact = true
6
- visit new_user_registration_path
7
- fill_in 'Email', with: email
8
- fill_in 'Password', with: password
9
- fill_in 'Password confirmation', with: password
10
- click_button 'Sign up'
11
- end
12
-
13
4
  def sign_in(who = :user)
14
- user = if who.instance_of?(User)
15
- who
16
- else
17
- FactoryGirl.build(:user).tap do |u|
18
- u.save!
19
- end
20
- end
5
+ logout
6
+ user = who.is_a?(User) ? who : FactoryGirl.build(:user).tap { |u| u.save! }
21
7
  visit new_user_session_path
22
8
  fill_in 'Email', with: user.email
23
9
  fill_in 'Password', with: user.password
24
10
  click_button 'Log in'
25
- expect(page).to_not have_text 'Invalid email or password.'
11
+ expect(page).not_to have_text 'Invalid email or password.'
26
12
  end
27
13
  end
28
14
  end
@@ -0,0 +1,36 @@
1
+ module Locations
2
+ def go_to_dashboard
3
+ visit '/dashboard'
4
+ # causes selenium to wait until text appears on the page
5
+ expect(page).to have_content('My Dashboard')
6
+ end
7
+
8
+ def go_to_dashboard_files
9
+ visit '/dashboard/files'
10
+ expect(page).to have_selector('li.active', text: "My Files")
11
+ end
12
+
13
+ def go_to_dashboard_collections
14
+ visit '/dashboard/collections'
15
+ expect(page).to have_content('My Collections')
16
+ end
17
+
18
+ def go_to_dashboard_shares
19
+ visit '/dashboard/shares'
20
+ expect(page).to have_content('Files Shared with Me')
21
+ end
22
+
23
+ def go_to_dashboard_highlights
24
+ visit '/dashboard/highlights'
25
+ expect(page).to have_content('My Highlights')
26
+ end
27
+
28
+ def go_to_user_profile
29
+ first(".dropdown-toggle").click
30
+ click_link "my profile"
31
+ end
32
+ end
33
+
34
+ RSpec.configure do |config|
35
+ config.include Locations
36
+ end
@@ -0,0 +1,11 @@
1
+ # This file causes capybara to use the phantomjs browser, which is fully
2
+ # compatible with ajax
3
+ require 'capybara/poltergeist'
4
+
5
+ # Register driver and tell it not to print javascript
6
+ Capybara.register_driver :poltergeist do |app|
7
+ Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: 90)
8
+ end
9
+
10
+ Capybara.default_driver = :poltergeist
11
+ Capybara.javascript_driver = :poltergeist
@@ -0,0 +1,14 @@
1
+ module ProxiesHelper
2
+ def create_proxy_using_partial(*users)
3
+ users.each do |user|
4
+ first('a.select2-choice').click
5
+ find(".select2-input").set(user.user_key)
6
+ expect(page).to have_css("div.select2-result-label")
7
+ first("div.select2-result-label").click
8
+ end
9
+ end
10
+
11
+ RSpec.configure do |config|
12
+ config.include ProxiesHelper
13
+ end
14
+ end
@@ -0,0 +1,122 @@
1
+ module Selectors
2
+
3
+ module Header
4
+
5
+ def user_notifications_link
6
+ within '#user_utility_links' do
7
+ find '#notify_link'
8
+ end
9
+ end
10
+
11
+ def user_utility_toggle
12
+ within '#user_utility_links' do
13
+ find '.dropdown-toggle.btn.btn-default'
14
+ end
15
+ end
16
+ end
17
+
18
+ module Dashboard
19
+
20
+ def db_item_actions_toggle item
21
+ within "#document_#{item.noid}" do
22
+ find '.dropdown-toggle'
23
+ end
24
+ end
25
+
26
+ def db_item_title item
27
+ within "#document_#{item.noid}" do
28
+ find "#src_copy_link#{item.noid}"
29
+ end
30
+ end
31
+
32
+ def db_file_checkbox file
33
+ within "#document_#{file.noid}" do
34
+ find '.batch_document_selector'
35
+ end
36
+ end
37
+
38
+ def db_collection_radio_button collection
39
+ within '#collection-list-container' do
40
+ find "input[id*='#{collection.noid}']"
41
+ end
42
+ end
43
+
44
+ def db_create_empty_collection_button
45
+ first '#hydra-collection-add'
46
+ end
47
+
48
+ def db_create_populated_collection_button
49
+ within '#collection-list-container' do
50
+ first '#hydra-collection-add'
51
+ end
52
+ end
53
+
54
+ def db_visibility_link file
55
+ within "#document_#{file.noid}" do
56
+ find "a#permission_#{file.noid}"
57
+ end
58
+ end
59
+
60
+ def db_facet_category_toggle id
61
+ find("a[data-target='#{id}']")
62
+ end
63
+ end
64
+
65
+ module EditCollections
66
+
67
+ def ec_update_submit
68
+ within '.col-xs-12.col-sm-10' do
69
+ within '.primary-actions' do
70
+ find_button 'Update Collection'
71
+ end
72
+ end
73
+ end
74
+
75
+ end
76
+
77
+ module NewTransfers
78
+
79
+ def new_owner_dropdown
80
+ find '#s2id_proxy_deposit_request_transfer_to'
81
+ end
82
+
83
+ def new_owner_search_field
84
+ within '#select2-drop' do
85
+ find '.select2-input'
86
+ end
87
+ end
88
+
89
+ def new_owner_search_result
90
+ within '#select2-drop' do
91
+ find '.select2-result-selectable'
92
+ end
93
+ end
94
+
95
+ def submit_button
96
+ within '#new_transfer' do
97
+ find 'input[type=submit]'
98
+ end
99
+ end
100
+ end
101
+
102
+ module Transfers
103
+
104
+ def first_sent_cancel_button
105
+ within '#outgoing-transfers' do
106
+ find '.btn.btn-danger'
107
+ end
108
+ end
109
+
110
+ def first_received_accept_dropdown
111
+ within '#incoming-transfers' do
112
+ find '.dropdown-toggle.accept'
113
+ end
114
+ end
115
+
116
+ def first_received_reject_button
117
+ within '#incoming-transfers' do
118
+ find '.btn.btn-danger'
119
+ end
120
+ end
121
+ end
122
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'batch/edit.html.erb' do
3
+ describe 'batch/edit.html.erb', :type => :view do
4
4
  let( :batch ) {
5
5
  stub_model(Batch, id: '123')
6
6
  }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'Check All' do
3
+ describe 'Check All', :type => :view do
4
4
  before (:all) do
5
5
  @document_list = ['a','b','c']
6
6
  @batch_size_on_other_page = 0
@@ -11,14 +11,14 @@ describe 'Check All' do
11
11
  allow(controller).to receive(:controller_name).and_return('batch_edits')
12
12
  controller.prepend_view_path "app/views/batch_edits"
13
13
  html = render partial: 'batch_edits/check_all'
14
- html.should have_selector("li[data-behavior='batch-edit-select-abc']")
14
+ expect(html).to have_selector("li[data-behavior='batch-edit-select-abc']")
15
15
  end
16
16
 
17
17
  it 'should render actions for my items' do
18
18
  allow(controller).to receive(:controller_name).and_return('my')
19
19
  controller.prepend_view_path "app/views/my"
20
20
  html = render partial: 'batch_edits/check_all'
21
- html.should have_selector("li[data-behavior='batch-edit-select-none']")
22
- html.should have_selector("li[data-behavior='batch-edit-select-page']")
21
+ expect(html).to have_selector("li[data-behavior='batch-edit-select-none']")
22
+ expect(html).to have_selector("li[data-behavior='batch-edit-select-page']")
23
23
  end
24
24
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'catalog/index.html.erb' do
3
+ describe 'catalog/index.html.erb', :type => :view do
4
4
  before do
5
5
  allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
6
6
  stub_template 'catalog/_search_sidebar.html.erb' => ''
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'catalog/_sort_and_per_page.html.erb' do
3
+ describe 'catalog/_sort_and_per_page.html.erb', :type => :view do
4
4
  before do
5
5
  allow(controller).to receive(:current_user).and_return(stub_model(User))
6
6
  allow_any_instance_of(Ability).to receive(:can?).and_return(true)
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'collections/_form.html.erb' do
3
+ describe 'collections/_form.html.erb', :type => :view do
4
4
  describe 'when the collection edit form is rendered' do
5
5
  let(:collection) { Collection.new({title: 'the title', description: 'the description',
6
6
  creator: 'the creator'})}
@@ -14,7 +14,9 @@ describe 'collections/_form.html.erb' do
14
14
  it "should draw the metadata fields for collection" do
15
15
  render
16
16
  expect(rendered).to have_selector("input#collection_title", count: 1)
17
+ expect(rendered).to_not have_selector("div#additional_title_clone button.adder")
17
18
  expect(rendered).to have_selector("input#collection_creator", count: 1)
19
+ expect(rendered).to have_selector("div#additional_creator_clone button.adder")
18
20
  expect(rendered).to have_selector("textarea#collection_description", count: 1)
19
21
  expect(rendered).to have_selector("input#collection_contributor", count: 1)
20
22
  expect(rendered).to have_selector("input#collection_tag", count: 1)
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'collections/_show_descriptions.html.erb' do
3
+ describe 'collections/_show_descriptions.html.erb', :type => :view do
4
4
  context 'displaying a custom collection' do
5
5
  before do
6
6
  @collection = mock_model(Collection)
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "dashboard/index.html.erb" do
3
+ describe "dashboard/index.html.erb", :type => :view do
4
4
 
5
5
  before do
6
6
  @user = mock_model(User, name: "Charles Francis Xavier", user_key: "charles")
@@ -8,8 +8,10 @@ describe "dashboard/index.html.erb" do
8
8
  allow(@user).to receive(:department).and_return("Xavier’s School for Gifted Youngsters")
9
9
  allow(@user).to receive(:telephone).and_return("814.865.8399")
10
10
  allow(@user).to receive(:email).and_return("chuck@xsgy.edu")
11
+ allow(@user).to receive(:login).and_return("chuck")
11
12
  allow(@user).to receive(:all_following).and_return(["magneto"])
12
13
  allow(@user).to receive(:followers).and_return(["wolverine","storm"])
14
+ allow(@user).to receive(:can_receive_deposits_from).and_return([])
13
15
  allow(controller).to receive(:current_user).and_return(@user)
14
16
  allow(view).to receive(:number_of_files).and_return("15")
15
17
  allow(view).to receive(:number_of_collections).and_return("3")
@@ -110,11 +112,9 @@ describe "dashboard/index.html.erb" do
110
112
  expect(rendered).to include "Single File 1"
111
113
  end
112
114
 
113
-
114
115
  end
115
116
 
116
117
  context "without activities and notifications" do
117
-
118
118
  it "should include headings for activities and notifications" do
119
119
  render
120
120
  expect(rendered).to include "User Activity"
@@ -126,9 +126,6 @@ describe "dashboard/index.html.erb" do
126
126
  expect(rendered).to include "User has no notifications"
127
127
  expect(rendered).to include "User has no recent activity"
128
128
  end
129
-
130
129
  end
131
-
132
130
  end
133
-
134
131
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'generic_files/edit.html.erb' do
3
+ describe 'generic_files/edit.html.erb', :type => :view do
4
4
  describe 'when the file has two or more resource types' do
5
5
  let(:generic_file) {
6
6
  content = double('content', versions: [], mimeType: 'application/pdf')
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'generic_files/show.html.erb' do
3
+ describe 'generic_files/show.html.erb', :type => :view do
4
4
  let(:depositor) {
5
5
  stub_model(User,
6
6
  user_key: 'bob',
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'generic_files/stats.html.erb' do
3
+ describe 'generic_files/stats.html.erb', :type => :view do
4
4
  describe 'usage statistics' do
5
5
  let(:generic_file) {
6
6
  stub_model(GenericFile, noid: '123',
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  # Note: this is a direct copy of the corresponding test in Blacklight
4
4
  # with changes for "views/my" instead of "views/catalog"
5
5
 
6
- describe "my/facet.html.erb" do
6
+ describe "my/facet.html.erb", :type => :view do
7
7
  let(:display_facet) { double }
8
8
  let(:blacklight_config) { Blacklight::Configuration.new }
9
9
  before do
10
10
  blacklight_config.add_facet_field "xyz", label: "Facet title"
11
- view.stub(:blacklight_config).and_return(blacklight_config)
11
+ allow(view).to receive(:blacklight_config).and_return(blacklight_config)
12
12
  allow(view).to receive(:blacklight_config).and_return(blacklight_config)
13
13
  stub_template "my/_facet_pagination.html.erb" => "pagination"
14
14
  assign :facet, blacklight_config.facet_fields["xyz"]
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'users/_follower_modal.html.erb' do
3
+ describe 'users/_follower_modal.html.erb', :type => :view do
4
4
  let(:user) { FactoryGirl.create(:user, display_name: "Frank") }
5
5
 
6
6
  before do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'users/_following_modal.html.erb' do
3
+ describe 'users/_following_modal.html.erb', :type => :view do
4
4
  let(:user) { FactoryGirl.create(:user, display_name: "Frank") }
5
5
 
6
6
  before do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'users/_notify_number.html.erb' do
3
+ describe 'users/_notify_number.html.erb', :type => :view do
4
4
 
5
5
  it "should draw user list" do
6
6
  assign :notify_number, 8
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe '/_user_util_links.html.erb' do
3
+ describe '/_user_util_links.html.erb', :type => :view do
4
4
 
5
5
  let(:join_date) { 5.days.ago }
6
6
  before do
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'users/index.html.erb' do
3
+ describe 'users/index.html.erb', :type => :view do
4
4
 
5
5
  let(:join_date) { 5.days.ago }
6
6
  before do
7
7
  users = []
8
8
  (1..25).each {|i| users << stub_model(User, name: "name#{i}", user_key: "user#{i}", created_at: join_date)}
9
- User.stub_chain(:all).and_return(users)
9
+ allow(User).to receive_message_chain(:all).and_return(users)
10
10
  relation = User.all
11
11
  allow(relation).to receive(:limit_value).and_return(10)
12
12
  allow(relation).to receive(:current_page).and_return(1)