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,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 ChecksumAuditLog do
18
4
  before(:all) 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 'event jobs' do
18
4
  before(:each) 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 FileContentDatastream do
18
4
  before do
@@ -72,10 +58,10 @@ describe FileContentDatastream do
72
58
  @subject.send(:fits_path).should be_present
73
59
  end
74
60
  it "should return an xml document", :unless => $in_travis do
75
- repo = mock("repo")
61
+ repo = double("repo")
76
62
  repo.stub(:config=>{})
77
63
  f = File.new(fixture_path + '/world.png')
78
- content = mock("file")
64
+ content = double("file")
79
65
  content.stub(:read=>f.read)
80
66
  content.stub(:rewind=>f.rewind)
81
67
  @subject.should_receive(:content).exactly(5).times.and_return(f)
@@ -84,11 +70,11 @@ describe FileContentDatastream do
84
70
  doc.root.xpath('//ns:imageWidth/text()', {'ns'=>'http://hul.harvard.edu/ois/xml/ns/fits/fits_output'}).inner_text.should == '50'
85
71
  end
86
72
  it "should return expected results when invoked via HTTP", :unless => $in_travis do
87
- repo = mock("repo")
73
+ repo = double("repo")
88
74
  repo.stub(:config=>{})
89
75
  f = ActionDispatch::Http::UploadedFile.new(:tempfile => File.new(fixture_path + '/world.png'),
90
76
  :filename => 'world.png')
91
- content = mock("file")
77
+ content = double("file")
92
78
  content.stub(:read=>f.read)
93
79
  content.stub(:rewind=>f.rewind)
94
80
  @subject.should_receive(:content).exactly(5).times.and_return(f)
@@ -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 FitsDatastream, :unless => $in_travis do
18
4
  before(:all) do
@@ -0,0 +1,34 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe GenericFile do
4
+ before do
5
+ subject.apply_depositor_metadata('jcoyne')
6
+ end
7
+
8
+ describe "terms_for_editing" do
9
+ it "should return a list" do
10
+ subject.terms_for_editing.should == [:resource_type, :title, :creator, :contributor, :description, :tag,
11
+ :rights, :publisher, :date_created, :subject, :language, :identifier, :based_near, :related_url]
12
+ end
13
+ end
14
+ describe "terms_for_display" do
15
+ it "should return a list" do
16
+ subject.terms_for_display.should == [:part_of, :resource_type, :title, :creator, :contributor, :description,
17
+ :tag, :rights, :publisher, :date_created, :date_uploaded, :date_modified, :subject, :language, :identifier,
18
+ :based_near, :related_url]
19
+ end
20
+ end
21
+
22
+ describe "accessible_attributes" do
23
+ it "should have a list" do
24
+ subject.accessible_attributes.should == [:part_of, :resource_type, :title, :creator, :contributor, :description,
25
+ :tag, :rights, :publisher, :date_created, :date_uploaded, :date_modified, :subject, :language, :identifier,
26
+ :based_near, :related_url, :permissions]
27
+ end
28
+
29
+ it "should sanitize them" do
30
+ subject.sanitize_attributes({'part_of' => 'A book', 'something_crazy' => "get's thrown out"}).should ==
31
+ {'part_of' => 'A book'}
32
+ end
33
+ end
34
+ end
@@ -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 GenericFile do
18
4
  before do
@@ -39,20 +25,6 @@ describe GenericFile do
39
25
  end
40
26
  end
41
27
 
42
- describe "terms_for_editing" do
43
- it "should return a list" do
44
- @file.terms_for_editing.should == [:resource_type, :title, :creator, :contributor, :description, :tag,
45
- :rights, :publisher, :date_created, :subject, :language, :identifier, :based_near, :related_url]
46
- end
47
- end
48
- describe "terms_for_display" do
49
- it "should return a list" do
50
- @file.terms_for_display.should == [:part_of, :resource_type, :title, :creator, :contributor, :description,
51
- :tag, :rights, :publisher, :date_created, :date_uploaded, :date_modified, :subject, :language, :identifier,
52
- :based_near, :related_url]
53
- end
54
- end
55
-
56
28
  describe "mime type recognition" do
57
29
  describe "image?" do
58
30
  it "should be true for jpeg2000" do
@@ -355,7 +327,7 @@ describe GenericFile do
355
327
  @f.save
356
328
  end
357
329
  it "should keep the thumbnail at the original size (but transform to png)" do
358
- @mock_image = mock("image", :from_blob=>true)
330
+ @mock_image = double("image", :from_blob=>true)
359
331
  @mock_image.should_not_receive(:scale)
360
332
  @mock_image.should_receive(:to_blob).and_return('fake content')
361
333
  Magick::ImageList.should_receive(:new).and_return(@mock_image)
@@ -398,31 +370,31 @@ describe GenericFile do
398
370
  @f = f.reload
399
371
  end
400
372
  it "should schedule a audit job for each datastream" do
401
- s1 = stub('one')
373
+ s1 = double('one')
402
374
  AuditJob.should_receive(:new).with(@f.pid, 'DC', "DC1.0").and_return(s1)
403
375
  Sufia.queue.should_receive(:push).with(s1)
404
- s2 = stub('two')
376
+ s2 = double('two')
405
377
  AuditJob.should_receive(:new).with(@f.pid, 'RELS-EXT', "RELS-EXT.0").and_return(s2)
406
378
  Sufia.queue.should_receive(:push).with(s2)
407
- s3 = stub('three')
379
+ s3 = double('three')
408
380
  AuditJob.should_receive(:new).with(@f.pid, 'rightsMetadata', "rightsMetadata.0").and_return(s3)
409
381
  Sufia.queue.should_receive(:push).with(s3)
410
- s4 = stub('four')
382
+ s4 = double('four')
411
383
  AuditJob.should_receive(:new).with(@f.pid, 'properties', "properties.0").and_return(s4)
412
384
  Sufia.queue.should_receive(:push).with(s4)
413
- s5 = stub('five')
385
+ s5 = double('five')
414
386
  AuditJob.should_receive(:new).with(@f.pid, 'content', "content.0").and_return(s5)
415
387
  Sufia.queue.should_receive(:push).with(s5)
416
388
  @f.audit!
417
389
  end
418
390
  it "should log a failing audit" do
419
391
  @f.datastreams.each { |ds| ds.stub(:dsChecksumValid).and_return(false) }
420
- GenericFile.stub(:run_audit).and_return(stub(:respose, :pass=>1, :created_at=>'2005-12-20', :pid=>'foo:123', :dsid=>'foo', :version=>'1'))
392
+ GenericFile.stub(:run_audit).and_return(double(:respose, :pass=>1, :created_at=>'2005-12-20', :pid=>'foo:123', :dsid=>'foo', :version=>'1'))
421
393
  @f.audit!
422
394
  ChecksumAuditLog.all.all? { |cal| cal.pass == 0 }.should be_true
423
395
  end
424
396
  it "should log a passing audit" do
425
- GenericFile.stub(:run_audit).and_return(stub(:respose, :pass=>1, :created_at=>'2005-12-20', :pid=>'foo:123', :dsid=>'foo', :version=>'1'))
397
+ GenericFile.stub(:run_audit).and_return(double(:respose, :pass=>1, :created_at=>'2005-12-20', :pid=>'foo:123', :dsid=>'foo', :version=>'1'))
426
398
  @f.audit!
427
399
  ChecksumAuditLog.all.all? { |cal| cal.pass == 1 }.should be_true
428
400
  end
@@ -516,7 +488,7 @@ describe GenericFile do
516
488
  @f2.add_relationship("isPartOf", "info:fedora/#{@batch_id}")
517
489
  @f1.save
518
490
  @f2.save
519
- mock_batch = mock("batch")
491
+ mock_batch = double("batch")
520
492
  mock_batch.stub(:generic_files => [@f1, @f2])
521
493
  @f1.should_receive(:batch).and_return(mock_batch)
522
494
  @f1.related_files.should == [@f2]
@@ -544,7 +516,7 @@ describe GenericFile do
544
516
  @f2.add_relationship("isPartOf", "info:fedora/#{@batch_id}")
545
517
  @f1.save
546
518
  @f2.save
547
- mock_batch = mock("batch")
519
+ mock_batch = double("batch")
548
520
  mock_batch.stub(:generic_files).and_raise(NoMethodError)
549
521
  @f1.should_receive(:batch).twice
550
522
  lambda { @f1.related_files }.should_not raise_error
@@ -1,19 +1,7 @@
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
 
3
+ # Don't run the tests if activerecord-import isn't installed.
4
+ # The 0.3.1 version doesn't work with rails 4, so suppress these tests
17
5
  describe LocalAuthority do
18
6
  before(:all) do
19
7
  @tsv = [fixture_path + '/cities15000.tsv']
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe PropertiesDatastream do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe SingleUseLink do
4
4
  before (:all) do
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe SolrDocument do
4
4
  describe "when mime-type is 'application/mxf'" do
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe TranscodeAudioJob, :if => Sufia.config.enable_ffmpeg do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe TranscodeVideoJob, :if => Sufia.config.enable_ffmpeg do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  describe Trophy do
4
4
  before(:all) 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 UnzipJob 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 User do
18
4
  before(:all) do
@@ -1,20 +1,6 @@
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.
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
14
2
 
15
3
  # Used to test the sufia-fixtures rake task
16
- #
17
- require "spec_helper"
18
4
  require "rake"
19
5
 
20
6
  describe "sufia:fixtures" do
@@ -56,8 +42,8 @@ describe "sufia:fixtures" do
56
42
  before(:each) do
57
43
  @rake = Rake::Application.new
58
44
  Rake.application = @rake
59
- Rake.application.rake_require("tasks/sufia-fixtures", ["."], loaded_files_excluding_current_rake_file)
60
- Rake.application.rake_require("lib/tasks/fixtures", ["."], loaded_files_excluding_current_rake_file)
45
+ Rake.application.rake_require("sufia-fixtures", ["#{Sufia::Engine.root}/tasks/"], loaded_files_excluding_current_rake_file)
46
+ Rake.application.rake_require("fixtures", ["#{Sufia::Engine.root}/lib/tasks/"], loaded_files_excluding_current_rake_file)
61
47
  Rake.application.rake_require("lib/tasks/active_fedora", [activefedora_path], loaded_files_excluding_current_rake_file)
62
48
  Rake::Task.define_task(:environment)
63
49
  end
@@ -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 'Routes' do
18
4
  before(:each) do
@@ -116,26 +102,26 @@ describe 'Routes' do
116
102
 
117
103
  describe 'Users' do
118
104
  it 'should route to user trophies' do
119
- { post: '/users/bob135/trophy' }.should route_to(controller: 'users', action: 'toggle_trophy', uid: 'bob135')
105
+ { post: '/users/bob135/trophy' }.should route_to(controller: 'users', action: 'toggle_trophy', id: 'bob135')
120
106
  end
121
107
  it 'should route to user profile' do
122
- { get: '/users/bob135' }.should route_to(controller: 'users', action: 'show', uid: 'bob135')
108
+ { get: '/users/bob135' }.should route_to(controller: 'users', action: 'show', id: 'bob135')
123
109
  end
124
110
 
125
111
  it "should route to edit profile" do
126
- { get: '/users/bob135/edit' }.should route_to(controller: 'users', action: 'edit', uid: 'bob135')
112
+ { get: '/users/bob135/edit' }.should route_to(controller: 'users', action: 'edit', id: 'bob135')
127
113
  end
128
114
 
129
115
  it "should route to update profile" do
130
- { put: '/users/bob135/update' }.should route_to(controller: 'users', action: 'update', uid: 'bob135')
116
+ { put: '/users/bob135' }.should route_to(controller: 'users', action: 'update', id: 'bob135')
131
117
  end
132
118
 
133
119
  it "should route to user follow" do
134
- { post: '/users/bob135/follow' }.should route_to(controller: 'users', action: 'follow', uid: 'bob135')
120
+ { post: '/users/bob135/follow' }.should route_to(controller: 'users', action: 'follow', id: 'bob135')
135
121
  end
136
122
 
137
123
  it "should route to user unfollow" do
138
- { post: '/users/bob135/unfollow' }.should route_to(controller: 'users', action: 'unfollow', uid: 'bob135')
124
+ { post: '/users/bob135/unfollow' }.should route_to(controller: 'users', action: 'unfollow', id: 'bob135')
139
125
  end
140
126
  end
141
127