sufia 3.1.2 → 3.1.3

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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +11 -0
  3. data/SUFIA_VERSION +1 -1
  4. data/app/controllers/authorities_controller.rb +0 -14
  5. data/app/controllers/batch_controller.rb +0 -14
  6. data/app/controllers/contact_form_controller.rb +0 -14
  7. data/app/controllers/dashboard_controller.rb +0 -14
  8. data/app/controllers/directory_controller.rb +0 -14
  9. data/app/controllers/downloads_controller.rb +0 -14
  10. data/app/controllers/errors_controller.rb +0 -14
  11. data/app/controllers/generic_files_controller.rb +0 -14
  12. data/app/controllers/mailbox_controller.rb +0 -14
  13. data/app/controllers/static_controller.rb +0 -14
  14. data/app/controllers/users_controller.rb +0 -14
  15. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -14
  16. data/app/helpers/contact_form_helper.rb +0 -14
  17. data/app/helpers/generic_file_helper.rb +0 -14
  18. data/app/helpers/sufia_helper.rb +0 -14
  19. data/app/helpers/trophy_helper.rb +0 -14
  20. data/app/jobs/content_delete_event_job.rb +0 -14
  21. data/app/jobs/content_deposit_event_job.rb +0 -14
  22. data/app/jobs/content_new_version_event_job.rb +0 -14
  23. data/app/jobs/content_restored_version_event_job.rb +0 -14
  24. data/app/jobs/content_update_event_job.rb +0 -14
  25. data/app/jobs/event_job.rb +0 -14
  26. data/app/jobs/user_edit_profile_event_job.rb +0 -14
  27. data/app/jobs/user_follow_event_job.rb +0 -14
  28. data/app/jobs/user_unfollow_event_job.rb +0 -14
  29. data/app/views/generic_files/_permission_form.html.erb +3 -3
  30. data/db/seeds.rb +0 -14
  31. data/lib/generators/sufia/templates/catalog_controller.rb +0 -14
  32. data/lib/generators/sufia/templates/config/action_dispatch_http_upload_monkey_patch.rb +0 -14
  33. data/lib/generators/sufia/templates/migrations/acts_as_follower_migration.rb +0 -14
  34. data/lib/generators/sufia/templates/migrations/add_avatars_to_users.rb +0 -14
  35. data/lib/generators/sufia/templates/migrations/add_groups_to_users.rb +0 -14
  36. data/lib/generators/sufia/templates/migrations/add_ldap_attrs_to_user.rb +0 -14
  37. data/lib/generators/sufia/templates/migrations/add_social_to_users.rb +0 -14
  38. data/lib/generators/sufia/templates/migrations/create_checksum_audit_logs.rb +0 -14
  39. data/lib/generators/sufia/templates/migrations/create_local_authorities.rb +0 -14
  40. data/lib/generators/sufia/templates/migrations/create_version_committers.rb +0 -14
  41. data/lib/sufia/contact_form_controller_behavior.rb +0 -14
  42. data/lib/sufia/controller.rb +0 -14
  43. data/lib/sufia/downloads_controller_behavior.rb +0 -14
  44. data/lib/sufia/files_controller/upload_complete_behavior.rb +5 -0
  45. data/lib/sufia/files_controller_behavior.rb +2 -1
  46. data/lib/sufia/role_mapper.rb +0 -14
  47. data/lib/sufia/version.rb +1 -1
  48. data/lib/tasks/fixtures.rake +0 -14
  49. data/spec/factories/checksum_audit_logs.rb +0 -14
  50. data/spec/lib/sufia/upload_complete_behavior_spec.rb +10 -0
  51. data/spec/models/access_right_spec.rb +57 -0
  52. data/spec/models/generic_file_spec.rb +1 -1
  53. data/spec/support/uploaded_file_monkeypatch.rb +0 -14
  54. data/sufia-models/app/models/batch.rb +0 -14
  55. data/sufia-models/app/models/concerns/sufia/models/access_right.rb +79 -0
  56. data/sufia-models/app/models/concerns/sufia/models/with_access_right.rb +33 -0
  57. data/sufia-models/app/models/datastreams/batch_rdf_datastream.rb +0 -14
  58. data/sufia-models/app/models/datastreams/fits_datastream.rb +0 -14
  59. data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +0 -14
  60. data/sufia-models/app/models/datastreams/properties_datastream.rb +0 -14
  61. data/sufia-models/app/models/follow.rb +0 -14
  62. data/sufia-models/app/models/subject_local_authority_entry.rb +0 -14
  63. data/sufia-models/lib/sufia/models/generic_file/visibility.rb +30 -26
  64. data/sufia-models/lib/sufia/models/id_service.rb +0 -14
  65. data/sufia-models/lib/sufia/models/jobs/audit_job.rb +0 -14
  66. data/sufia-models/lib/sufia/models/jobs/characterize_job.rb +0 -14
  67. data/sufia-models/lib/sufia/models/jobs/resolrize_job.rb +0 -14
  68. data/sufia-models/lib/sufia/models/jobs/unzip_job.rb +0 -14
  69. data/sufia-models/lib/sufia/models/noid.rb +0 -14
  70. data/sufia-models/lib/sufia/models/solr_document_behavior.rb +0 -14
  71. data/sufia-models/lib/sufia/models/user.rb +0 -14
  72. data/sufia-models/lib/sufia/models/utils.rb +0 -14
  73. data/sufia-models/lib/sufia/models/version.rb +1 -1
  74. data/sufia-models/lib/tasks/resque.rake +0 -14
  75. data/tasks/sufia-db.rake +0 -14
  76. data/tasks/sufia-fixtures.rake +0 -14
  77. data/tasks/sufia.rake +0 -14
  78. metadata +8 -4
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class UserEditProfileEventJob < EventJob
16
2
  attr_accessor :editor_id
17
3
 
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class UserFollowEventJob < EventJob
16
2
  attr_accessor :follower_id, :followee_id
17
3
 
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class UserUnfollowEventJob < EventJob
16
2
  attr_accessor :unfollower_id, :unfollowee_id
17
3
 
@@ -60,13 +60,13 @@
60
60
  <h3>Visibility - <small>who should have the ability to read and download</small></h3>
61
61
  <div class="controls">
62
62
  <label class="radio">
63
- <input type="radio" id="visibility_open" name="visibility" value="open" <% if !public_perm.blank? %> checked="true"<% end %>/> <span class="label label-success">Open Access</span> Visible to the world.
63
+ <input type="radio" id="visibility_open" name="visibility" value="<%=Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>" <% if !public_perm.blank? %> checked="true"<% end %>/> <span class="label label-success">Open Access</span> Visible to the world.
64
64
  </label>
65
65
  <label class="radio">
66
- <input type="radio" id="visibility_psu" name="visibility" value="psu" <% if !registered_perm.blank? %> checked="true"<% end %> /><span class="label label-info"><%=t('sufia.institution_name') %></span> Visible to all <%=t('sufia.institution_name') %> users.
66
+ <input type="radio" id="visibility_psu" name="visibility" value="<%=Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>" <% if !registered_perm.blank? %> checked="true"<% end %> /><span class="label label-info"><%=t('sufia.institution_name') %></span> Visible to all <%=t('sufia.institution_name') %> users.
67
67
  </label>
68
68
  <label class="radio">
69
- <input type="radio" id="visibility_restricted" name="visibility" value="restricted"<% if registered_perm.blank? and public_perm.blank?%> checked="true"<% end %> /> <span class="label label-important">Private</span> Visible to users/groups specified below, if any.
69
+ <input type="radio" id="visibility_restricted" name="visibility" value="<%=Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE %>"<% if registered_perm.blank? and public_perm.blank?%> checked="true"<% end %> /> <span class="label label-important">Private</span> Visible to users/groups specified below, if any.
70
70
  </label>
71
71
  </div><!-- /.controls -->
72
72
  </div><!-- /.control-group -->
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  # This file should contain all the record creation needed to seed the database with its default values.
16
2
  # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
17
3
  #
@@ -1,18 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright © 2012 The Pennsylvania State University
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
2
  # -*- encoding : utf-8 -*-
17
3
  require 'blacklight/catalog'
18
4
  require 'blacklight_advanced_search'
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  module ActionDispatch
16
2
  module Http
17
3
  class UploadedFile
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class ActsAsFollowerMigration < ActiveRecord::Migration
16
2
  def self.up
17
3
  create_table :follows, :force => true do |t|
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class AddAvatarsToUsers < ActiveRecord::Migration
16
2
  def self.up
17
3
  add_attachment :users, :avatar
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class AddGroupsToUsers < ActiveRecord::Migration
16
2
  def self.up
17
3
  add_column :users, :group_list, :text
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class AddLdapAttrsToUser < ActiveRecord::Migration
16
2
  def self.up
17
3
  add_column :users, :display_name, :string
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class AddSocialToUsers < ActiveRecord::Migration
16
2
  def self.up
17
3
  add_column :users, :facebook_handle, :string
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class CreateChecksumAuditLogs < ActiveRecord::Migration
16
2
  def self.up
17
3
  create_table :checksum_audit_logs do |t|
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class CreateLocalAuthorities < ActiveRecord::Migration
16
2
  def self.up
17
3
  create_table :local_authority_entries, :force => true do |t|
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class CreateVersionCommitters < ActiveRecord::Migration
16
2
  def self.up
17
3
  create_table :version_committers do |t|
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  module Sufia
16
2
  module ContactFormControllerBehavior
17
3
 
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  module Sufia::Controller
16
2
  extend ActiveSupport::Concern
17
3
 
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  module Sufia
16
2
  module DownloadsControllerBehavior
17
3
  extend ActiveSupport::Concern
@@ -3,5 +3,10 @@ module Sufia
3
3
  def upload_complete_path(batch_id)
4
4
  Sufia::Engine.routes.url_helpers.batch_edit_path(batch_id)
5
5
  end
6
+
7
+ def destroy_complete_path(params)
8
+ Sufia::Engine.routes.url_helpers.dashboard_index_path
9
+ end
10
+
6
11
  end # /FilesController::UploadCompleteBehavior
7
12
  end # /Sufia
@@ -57,7 +57,7 @@ module Sufia
57
57
  pid = @generic_file.noid
58
58
  @generic_file.destroy
59
59
  Sufia.queue.push(ContentDeleteEventJob.new(pid, current_user.user_key))
60
- redirect_to sufia.dashboard_index_path, :notice => render_to_string(:partial=>'generic_files/asset_deleted_flash', :locals => { :generic_file => @generic_file })
60
+ redirect_to self.class.destroy_complete_path(params), :notice => render_to_string(:partial=>'generic_files/asset_deleted_flash', :locals => { :generic_file => @generic_file })
61
61
  end
62
62
 
63
63
  # routed to /files (POST)
@@ -167,6 +167,7 @@ module Sufia
167
167
 
168
168
  protected
169
169
 
170
+
170
171
  def json_error(error, name=nil, additional_arguments={})
171
172
  args = {:error => error}
172
173
  args[:name] = name if name
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  class RoleMapper
16
2
  def self.roles(uid)
17
3
  u = User.find_by_login(uid)
@@ -1,3 +1,3 @@
1
1
  module Sufia
2
- VERSION = "3.1.2"
2
+ VERSION = "3.1.3"
3
3
  end
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  # sufia-fixtures
16
2
  #
17
3
  # This was extracted from the original Hydra version in
@@ -1,17 +1,3 @@
1
- # Copyright © 2012 The Pennsylvania State University
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  # Read about factories at http://github.com/thoughtbot/factory_girl
16
2
 
17
3
  FactoryGirl.define do
@@ -9,6 +9,10 @@ class UploadThingRedefine
9
9
  return "example.com"
10
10
  end
11
11
 
12
+ def self.destroy_complete_path(id)
13
+ return "destroy.com"
14
+ end
15
+
12
16
  end
13
17
 
14
18
  describe Sufia::FilesController::UploadCompleteBehavior do
@@ -17,10 +21,16 @@ describe Sufia::FilesController::UploadCompleteBehavior do
17
21
  it "respond with the batch edit path" do
18
22
  UploadThing.upload_complete_path(test_id).should == Sufia::Engine.routes.url_helpers.batch_edit_path(test_id)
19
23
  end
24
+ it "respond with the dashboard path" do
25
+ UploadThing.destroy_complete_path({}).should == Sufia::Engine.routes.url_helpers.dashboard_index_path
26
+ end
20
27
  end
21
28
  context "overriden path" do
22
29
  it "respond with the batch edit path" do
23
30
  UploadThingRedefine.upload_complete_path(test_id).should == "example.com"
24
31
  end
32
+ it "respond with the batch edit path" do
33
+ UploadThingRedefine.destroy_complete_path(test_id).should == "destroy.com"
34
+ end
25
35
  end
26
36
  end