sufia 2.0.1 → 3.0.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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +111 -0
  3. data/Gemfile +4 -4
  4. data/History.md +126 -0
  5. data/README.md +23 -5
  6. data/SUFIA_VERSION +1 -1
  7. data/app/assets/javascripts/sufia/multiForm.js +10 -2
  8. data/app/assets/stylesheets/{application-bootstrap.css → application-bootstrap.css.erb} +7 -7
  9. data/app/assets/stylesheets/{bootstrap.min.css → bootstrap.min.css.erb} +1 -1
  10. data/app/controllers/concerns/sufia/users_controller_behavior.rb +9 -3
  11. data/app/controllers/single_use_link_controller.rb +1 -1
  12. data/app/helpers/sufia_helper.rb +7 -1
  13. data/app/models/contact_form.rb +0 -14
  14. data/app/views/_user_util_links.html.erb +0 -15
  15. data/app/views/batch_edits/_check_all.html.erb +2 -2
  16. data/app/views/batch_edits/_delete_selected.html.erb +1 -1
  17. data/app/views/layouts/{_head-tag-content.html.erb → _head_tag_content.html.erb} +0 -0
  18. data/app/views/layouts/homepage.html.erb +2 -2
  19. data/app/views/layouts/sufia-one-column.html.erb +1 -1
  20. data/app/views/layouts/sufia-two-column.html.erb +1 -1
  21. data/app/views/users/edit.html.erb +1 -1
  22. data/app/views/users/show.html.erb +1 -17
  23. data/config/routes.rb +31 -33
  24. data/lib/generators/sufia/sufia_generator.rb +5 -3
  25. data/lib/generators/sufia/templates/catalog_controller.rb +5 -1
  26. data/lib/generators/sufia/templates/config/redis_config.rb +1 -14
  27. data/lib/sufia/batch_edits_controller_behavior.rb +1 -1
  28. data/lib/sufia/controller.rb +1 -1
  29. data/lib/sufia/dashboard_controller_behavior.rb +8 -2
  30. data/lib/sufia/files_controller_behavior.rb +1 -2
  31. data/lib/sufia/version.rb +1 -1
  32. data/spec/active_fedora/unsaved_digital_object_spec.rb +1 -15
  33. data/spec/controllers/authorities_controller_spec.rb +1 -15
  34. data/spec/controllers/batch_controller_spec.rb +10 -16
  35. data/spec/controllers/batch_edits_controller_spec.rb +1 -1
  36. data/spec/controllers/catalog_controller_spec.rb +1 -15
  37. data/spec/controllers/dashboard_controller_spec.rb +23 -17
  38. data/spec/controllers/downloads_controller_spec.rb +1 -15
  39. data/spec/controllers/generic_files_controller_spec.rb +18 -32
  40. data/spec/controllers/mailbox_controller_spec.rb +1 -15
  41. data/spec/controllers/single_use_link_controller_spec.rb +6 -13
  42. data/spec/controllers/users_controller_spec.rb +27 -41
  43. data/spec/factories/users.rb +5 -14
  44. data/spec/features/browse_dashboard_files.rb +21 -0
  45. data/spec/features/browse_files.rb +31 -0
  46. data/spec/features/contact_form.rb +99 -0
  47. data/spec/features/display_dashboard.rb +46 -0
  48. data/spec/features/ingest_upload_files.rb +24 -0
  49. data/spec/features/users_spec.rb +25 -0
  50. data/spec/helpers/generic_file_helper_spec.rb +10 -3
  51. data/spec/helpers/sufia_helper_spec.rb +1 -1
  52. data/spec/lib/sufia/id_service_spec.rb +1 -15
  53. data/spec/models/audit_job_spec.rb +1 -15
  54. data/spec/models/batch_spec.rb +1 -15
  55. data/spec/models/batch_update_job_spec.rb +3 -16
  56. data/spec/models/characterize_job_spec.rb +4 -4
  57. data/spec/models/checksum_audit_log_spec.rb +1 -15
  58. data/spec/models/event_jobs_spec.rb +1 -15
  59. data/spec/models/file_content_datastream_spec.rb +5 -19
  60. data/spec/models/fits_datastream_spec.rb +1 -15
  61. data/spec/models/generic_file/web_form_spec.rb +34 -0
  62. data/spec/models/generic_file_spec.rb +11 -39
  63. data/spec/models/local_authority_spec.rb +3 -15
  64. data/spec/models/properties_datastream_spec.rb +1 -1
  65. data/spec/models/single_use_link_spec.rb +1 -1
  66. data/spec/models/solr_document_spec.rb +1 -1
  67. data/spec/models/transcode_audio_job_spec.rb +1 -1
  68. data/spec/models/transcode_video_job_spec.rb +1 -1
  69. data/spec/models/trophy_spec.rb +1 -1
  70. data/spec/models/unzip_job_spec.rb +1 -15
  71. data/spec/models/user_spec.rb +1 -15
  72. data/spec/rake/sufia_fixtures_spec.rb +3 -17
  73. data/spec/routing/route_spec.rb +7 -21
  74. data/spec/spec_helper.rb +8 -20
  75. data/spec/support/features.rb +6 -0
  76. data/spec/support/features/session_helpers.rb +21 -0
  77. data/spec/support/lib/generators/test_app_generator.rb +4 -0
  78. data/spec/views/batch_edits/check_all_spec.rb +6 -4
  79. data/sufia-models/app/models/checksum_audit_log.rb +1 -15
  80. data/sufia-models/app/models/domain_term.rb +3 -15
  81. data/sufia-models/app/models/geo_names_resource.rb +1 -13
  82. data/sufia-models/app/models/local_authority.rb +12 -17
  83. data/sufia-models/app/models/local_authority_entry.rb +1 -15
  84. data/sufia-models/app/models/single_use_link.rb +2 -3
  85. data/sufia-models/app/models/trophy.rb +1 -1
  86. data/sufia-models/app/models/version_committer.rb +1 -15
  87. data/sufia-models/lib/sufia/models.rb +6 -2
  88. data/sufia-models/lib/sufia/models/engine.rb +1 -1
  89. data/sufia-models/lib/sufia/models/generic_file.rb +3 -0
  90. data/sufia-models/lib/sufia/models/generic_file/accessible_attributes.rb +87 -0
  91. data/sufia-models/lib/sufia/models/generic_file/permissions.rb +2 -1
  92. data/sufia-models/lib/sufia/models/generic_file/web_form.rb +4 -1
  93. data/sufia-models/lib/sufia/models/user.rb +9 -2
  94. data/sufia-models/lib/sufia/models/version.rb +1 -1
  95. data/{lib → sufia-models/lib}/tasks/resque.rake +0 -0
  96. data/sufia-models/sufia-models.gemspec +13 -11
  97. data/sufia.gemspec +1 -3
  98. data/tasks/sufia-dev.rake +21 -10
  99. metadata +30 -84
  100. data/config/cucumber.yml +0 -8
  101. data/features/browse_dashboard_files.feature +0 -16
  102. data/features/browse_files.feature +0 -16
  103. data/features/contact_form.feature +0 -86
  104. data/features/display_dashboard.feature +0 -42
  105. data/features/ingest_upload_files.feature +0 -21
  106. data/features/step_definitions/edit_metadata_steps.rb +0 -89
  107. data/features/step_definitions/fixture_steps.rb +0 -35
  108. data/features/step_definitions/show_document_steps.rb +0 -103
  109. data/features/step_definitions/sufia.rb +0 -69
  110. data/features/step_definitions/user_steps.rb +0 -58
  111. data/features/step_definitions/web_steps.rb +0 -235
  112. data/features/support/cleanup.rb +0 -19
  113. data/features/support/env.rb +0 -90
  114. data/features/support/headless.rb +0 -26
  115. data/features/support/paths.rb +0 -101
  116. data/features/users.feature +0 -18
  117. data/spec/lib/sufia/role_mapper_spec.rb +0 -28
  118. data/spec/support/Gemfile +0 -24
  119. data/spec/views/single_user_link/download.html.erb_spec.rb +0 -5
  120. data/spec/views/single_user_link/generate_download.html.erb_spec.rb +0 -5
  121. data/spec/views/single_user_link/generate_show.html.erb_spec.rb +0 -5
  122. data/spec/views/single_user_link/show.html.erb_spec.rb +0 -5
  123. data/tasks/cucumber.rake +0 -72
@@ -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
  FactoryGirl.define do
16
2
  factory :user, :class => User do |u|
17
3
  email 'jilluser@example.com'
@@ -23,6 +9,11 @@ FactoryGirl.define do
23
9
  password 'password'
24
10
  end
25
11
 
12
+ factory :user_with_fixtures, :class => User do |u|
13
+ email 'archivist2@example.com'
14
+ password 'password'
15
+ end
16
+
26
17
  factory :curator, :class => User do |u|
27
18
  email 'curator1@example.com'
28
19
  password 'password'
@@ -0,0 +1,21 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Browse Dashboard files" do
4
+
5
+ before do
6
+ sign_in :user_with_fixtures
7
+ end
8
+
9
+ it "should show me some files (from the fixtures)" do
10
+ click_link "dashboard"
11
+ click_link "more Keywords"
12
+ click_link "keyf"
13
+ page.should have_content "Test mp3"
14
+ end
15
+
16
+ it "should allow me to edit files (from the fixtures)" do
17
+ click_link "dashboard"
18
+ click_link "Edit File"
19
+ page.should have_content "Edit Test mp3"
20
+ end
21
+ end
@@ -0,0 +1,31 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Browse files" do
4
+
5
+ describe "when not logged in" do
6
+ it "should let us browse some of the fixtures" do
7
+ visit '/'
8
+ click_link "more Keywords"
9
+ click_link "test"
10
+ # TODO this used to be 1 - 4 of 4, but now we get 5. WTF?
11
+ # It looks to me like sufia:sufia1, sufia:test3, sufia:test4, sufia:test5, sufia:test6 all should match
12
+ page.should have_content "1 - 5 of 5"
13
+ click_link "Test Document PDF"
14
+ page.should have_content "Download"
15
+ page.should_not have_content "Edit"
16
+ end
17
+
18
+ end
19
+
20
+ describe "when logged in" do
21
+ before do
22
+ sign_in :user
23
+ end
24
+ it "should let us browse some of the fixtures and see the edit link"do
25
+ click_link "more Keywords"
26
+ click_link "test"
27
+ click_link "Test Document PDF"
28
+ page.should_not have_content "Edit"
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,99 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Sending an email via the contact form" do
4
+
5
+ before do
6
+ sign_in :user_with_fixtures
7
+ end
8
+
9
+ it "should send mail" do
10
+ ContactForm.any_instance.stub(:deliver).and_return(true)
11
+ visit '/'
12
+ click_link "Contact"
13
+ page.should have_content "Contact Form"
14
+ fill_in "contact_form_name", with: "Test McPherson"
15
+ fill_in "contact_form_email", with: "archivist1@example.com"
16
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
17
+ fill_in "contact_form_subject", with: "My Subject is Cool"
18
+ select "Depositing content", from: "contact_form_category"
19
+ click_button "Send"
20
+ page.should have_content "Thank you"
21
+ # this step allows the delivery to go back to normal
22
+ ContactForm.any_instance.unstub(:deliver)
23
+ end
24
+
25
+ it "should give an error when I don't provide a contact type" do
26
+ visit '/'
27
+ click_link "Contact"
28
+ page.should have_content "Contact Form"
29
+ fill_in "contact_form_name", with: "Test McPherson"
30
+ fill_in "contact_form_email", with: "archivist1@example.com"
31
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
32
+ fill_in "contact_form_subject", with: "My Subject is Cool"
33
+ click_button "Send"
34
+ page.should have_content "Sorry, this message was not sent successfully"
35
+ end
36
+
37
+ it "should give an error when I don't provide a valid email" do
38
+ visit '/'
39
+ click_link "Contact"
40
+ page.should have_content "Contact Form"
41
+ fill_in "contact_form_name", with: "Test McPherson"
42
+ fill_in "contact_form_email", with: "archivist1"
43
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
44
+ fill_in "contact_form_subject", with: "My Subject is Cool"
45
+ select "Depositing content", from: "contact_form_category"
46
+ click_button "Send"
47
+ page.should have_content "Sorry, this message was not sent successfully"
48
+ end
49
+
50
+ it "should give an error when I don't provide a name" do
51
+ visit '/'
52
+ click_link "Contact"
53
+ page.should have_content "Contact Form"
54
+ fill_in "contact_form_email", with: "archivist1@example.com"
55
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
56
+ fill_in "contact_form_subject", with: "My Subject is Cool"
57
+ select "Depositing content", from: "contact_form_category"
58
+ click_button "Send"
59
+ page.should have_content "Sorry, this message was not delivered"
60
+ end
61
+
62
+ it "should give an error when I don't provide a subject" do
63
+ visit '/'
64
+ click_link "Contact"
65
+ page.should have_content "Contact Form"
66
+ fill_in "contact_form_name", with: "Test McPherson"
67
+ fill_in "contact_form_email", with: "archivist1@example.com"
68
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
69
+ select "Depositing content", from: "contact_form_category"
70
+ click_button "Send"
71
+ page.should have_content "Sorry, this message was not sent successfully"
72
+ end
73
+
74
+ it "should give an error when I don't provide a message" do
75
+ visit '/'
76
+ click_link "Contact"
77
+ page.should have_content "Contact Form"
78
+ fill_in "contact_form_name", with: "Test McPherson"
79
+ fill_in "contact_form_email", with: "archivist1@example.com"
80
+ fill_in "contact_form_subject", with: "My Subject is Cool"
81
+ select "Depositing content", from: "contact_form_category"
82
+ click_button "Send"
83
+ page.should have_content "Sorry, this message was not sent successfully"
84
+ end
85
+
86
+ it "should give an error when I provide an invalid captcha" do
87
+ visit '/'
88
+ click_link "Contact"
89
+ page.should have_content "Contact Form"
90
+ fill_in "contact_form_contact_method", with: "My name is"
91
+ fill_in "contact_form_name", with: "Test McPherson"
92
+ fill_in "contact_form_email", with: "archivist1@example.com"
93
+ fill_in "contact_form_subject", with: "My Subject is Cool"
94
+ fill_in "contact_form_message", with: "I am contacting you regarding ScholarSphere."
95
+ select "Depositing content", from: "contact_form_category"
96
+ click_button "Send"
97
+ page.should have_content "Sorry, this message was not delivered"
98
+ end
99
+ end
@@ -0,0 +1,46 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Display Dashboard files" do
4
+
5
+ before do
6
+ sign_in :user
7
+ end
8
+
9
+ it "should display the dashboard and have search" do
10
+ click_link 'dashboard'
11
+ fill_in "dashboard_search", with: "dash search"
12
+ click_button "dashboard_submit"
13
+ page.should have_content "Dashboard"
14
+ page.should have_content "You searched for: dash search"
15
+ find_field("search-field-header").value.should be_nil
16
+ end
17
+
18
+ it "should display the dashboard and want to upload files" do
19
+ click_link 'dashboard'
20
+ click_link 'Upload File(s)'
21
+ page.should have_content "Upload"
22
+ end
23
+
24
+ it "should display the dashboard and want to upload files" do
25
+ click_link 'dashboard'
26
+ click_link 'Upload File(s)'
27
+ page.should have_content "Upload"
28
+ end
29
+
30
+ it "should display the dashboard and want to search the whole system" do
31
+ fill_in "search-field-header", with: "system search"
32
+ click_button "search-submit-header"
33
+ page.should have_content "You searched for: system search"
34
+ page.should_not have_content "Dashboard"
35
+ find_field("search-field-header").value.should match(/system search/)
36
+ end
37
+
38
+ # @culerity
39
+ # Scenario: I have files on my dashboard I should see icons
40
+ # #Given I load sufia fixtures
41
+ # And I am logged in as "archivist1@example.com"
42
+ # And I follow "dashboard"
43
+ # Then I should see "Test Document Text"
44
+ # When I follow the link within "a[href='/files/test3'].itemtrash"
45
+ # Then I should see "The file has been deleted"
46
+ end
@@ -0,0 +1,24 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Uploading files via web form" do
4
+
5
+ before do
6
+ sign_in :user
7
+ end
8
+
9
+ it "should have an ingest screen" do
10
+ click_link "upload"
11
+ page.should have_content "Select files"
12
+ page.should have_content "Start upload"
13
+ page.should have_content "Cancel upload"
14
+ page.should have_xpath '//input[@type="file"]'
15
+ end
16
+
17
+ it "should require checking the terms of service" do
18
+ click_link "upload"
19
+ attach_file("files[]", "spec/fixtures/image.jp2")
20
+ attach_file("files[]", "spec/fixtures/jp2_fits.xml")
21
+ click_button 'Start upload'
22
+ page.should have_content "You must accept the terms of service!"
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "User Profile" do
4
+
5
+ before do
6
+ # FactoryGirl.create(:user)
7
+ # FactoryGirl.create(:archivist)
8
+ # FactoryGirl.create(:curator)
9
+ sign_in :curator
10
+ end
11
+
12
+ it "should be displayed" do
13
+ click_link "curator1@example.com"
14
+ page.should have_content "Edit Your Profile"
15
+ end
16
+
17
+ it "should be editable" do
18
+ click_link "curator1@example.com"
19
+ click_link "Edit Your Profile"
20
+ fill_in 'user_twitter_handle', with: 'curatorOfData'
21
+ click_button 'Save Profile'
22
+ page.should have_content "Your profile has been updated"
23
+ page.should have_content "curatorOfData"
24
+ end
25
+ end
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe GenericFileHelper do
4
4
  it "draws add button" do
@@ -12,8 +12,15 @@ describe GenericFileHelper do
12
12
  end
13
13
 
14
14
  it "draws help_icon" do
15
- helper.help_icon(:tag).should ==
16
- "<a href=\"#\" data-content=\"Words or phrases you select to describe what the file is about. These are used to search for content. &lt;em&gt;This is a required field&lt;/em&gt;.\" data-original-title=\"Keyword\" id=\"generic_file_tag_help\" rel=\"popover\"><i class=\"icon-question-sign icon-large\"></i></a>"
15
+ str = String.new(helper.help_icon(:tag))
16
+ doc = Nokogiri::HTML(str)
17
+ a = doc.xpath('//a').first
18
+
19
+ a.attr('data-content').should == "Words or phrases you select to describe what the file is about. These are used to search for content. <em>This is a required field</em>."
20
+ a.attr('data-original-title').should == "Keyword"
21
+ a.attr('id').should == "generic_file_tag_help"
22
+ i = a.children.first
23
+ i.attr('class').should == 'icon-question-sign icon-large'
17
24
  end
18
25
 
19
26
  end
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe SufiaHelper do
4
4
  describe "link_to_profile" do
@@ -1,18 +1,4 @@
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
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
16
2
 
17
3
  describe Sufia::IdService do
18
4
  describe "mint" do
@@ -1,18 +1,4 @@
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
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
16
2
 
17
3
  describe AuditJob do
18
4
  before do
@@ -1,18 +1,4 @@
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
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
16
2
 
17
3
  describe Batch do
18
4
  before(:all) do
@@ -1,19 +1,6 @@
1
1
  # encoding: 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
2
 
16
- require 'spec_helper'
3
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
17
4
 
18
5
  describe BatchUpdateJob do
19
6
  before do
@@ -47,10 +34,10 @@ describe BatchUpdateJob do
47
34
  it "should log a content update event" do
48
35
  User.any_instance.should_receive(:can?).with(:edit, @file).and_return(true)
49
36
  User.any_instance.should_receive(:can?).with(:edit, @file2).and_return(true)
50
- s1 = stub('one')
37
+ s1 = double('one')
51
38
  ContentUpdateEventJob.should_receive(:new).with(@file.pid, @user.user_key).and_return(s1)
52
39
  Sufia.queue.should_receive(:push).with(s1).once
53
- s2 = stub('two')
40
+ s2 = double('two')
54
41
  ContentUpdateEventJob.should_receive(:new).with(@file2.pid, @user.user_key).and_return(s2)
55
42
  Sufia.queue.should_receive(:push).with(s2).once
56
43
  params = {'generic_file' => {'read_groups_string' => '', 'read_users_string' => 'archivist1, archivist2', 'tag' => ['']}, 'id' => @batch.pid, 'controller' => 'batch', 'action' => 'update'}.with_indifferent_access
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe CharacterizeJob do
4
4
  before do
@@ -20,7 +20,7 @@ describe CharacterizeJob do
20
20
  @generic_file.save!
21
21
  end
22
22
  it "should create a transcode job" do
23
- job = stub("stub video job")
23
+ job = double("stub video job")
24
24
  if $in_travis
25
25
  @generic_file.stub(:video?).and_return(true)
26
26
  GenericFile.should_receive(:find).with(@generic_file.id).and_return(@generic_file)
@@ -42,7 +42,7 @@ describe CharacterizeJob do
42
42
  @generic_file.save!
43
43
  end
44
44
  it "should create a transcode job" do
45
- job = stub("stub audio job")
45
+ job = double("stub audio job")
46
46
  if $in_travis
47
47
  @generic_file.stub(:audio?).and_return(true)
48
48
  GenericFile.should_receive(:find).with(@generic_file.id).and_return(@generic_file)
@@ -61,7 +61,7 @@ describe CharacterizeJob do
61
61
  end
62
62
  it "should create a transcode job. (we'd like ogg too)" do
63
63
  # TODO just copy the 'content' datastream to the mp3 datastream if it's an mp3, and then transcode to ogg
64
- job = stub("stub audio job")
64
+ job = double("stub audio job")
65
65
  if $in_travis
66
66
  @generic_file.stub(:audio?).and_return(true)
67
67
  GenericFile.should_receive(:find).with(@generic_file.id).and_return(@generic_file)