sufia 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +111 -0
- data/Gemfile +4 -4
- data/History.md +126 -0
- data/README.md +23 -5
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/sufia/multiForm.js +10 -2
- data/app/assets/stylesheets/{application-bootstrap.css → application-bootstrap.css.erb} +7 -7
- data/app/assets/stylesheets/{bootstrap.min.css → bootstrap.min.css.erb} +1 -1
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +9 -3
- data/app/controllers/single_use_link_controller.rb +1 -1
- data/app/helpers/sufia_helper.rb +7 -1
- data/app/models/contact_form.rb +0 -14
- data/app/views/_user_util_links.html.erb +0 -15
- data/app/views/batch_edits/_check_all.html.erb +2 -2
- data/app/views/batch_edits/_delete_selected.html.erb +1 -1
- data/app/views/layouts/{_head-tag-content.html.erb → _head_tag_content.html.erb} +0 -0
- data/app/views/layouts/homepage.html.erb +2 -2
- data/app/views/layouts/sufia-one-column.html.erb +1 -1
- data/app/views/layouts/sufia-two-column.html.erb +1 -1
- data/app/views/users/edit.html.erb +1 -1
- data/app/views/users/show.html.erb +1 -17
- data/config/routes.rb +31 -33
- data/lib/generators/sufia/sufia_generator.rb +5 -3
- data/lib/generators/sufia/templates/catalog_controller.rb +5 -1
- data/lib/generators/sufia/templates/config/redis_config.rb +1 -14
- data/lib/sufia/batch_edits_controller_behavior.rb +1 -1
- data/lib/sufia/controller.rb +1 -1
- data/lib/sufia/dashboard_controller_behavior.rb +8 -2
- data/lib/sufia/files_controller_behavior.rb +1 -2
- data/lib/sufia/version.rb +1 -1
- data/spec/active_fedora/unsaved_digital_object_spec.rb +1 -15
- data/spec/controllers/authorities_controller_spec.rb +1 -15
- data/spec/controllers/batch_controller_spec.rb +10 -16
- data/spec/controllers/batch_edits_controller_spec.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +1 -15
- data/spec/controllers/dashboard_controller_spec.rb +23 -17
- data/spec/controllers/downloads_controller_spec.rb +1 -15
- data/spec/controllers/generic_files_controller_spec.rb +18 -32
- data/spec/controllers/mailbox_controller_spec.rb +1 -15
- data/spec/controllers/single_use_link_controller_spec.rb +6 -13
- data/spec/controllers/users_controller_spec.rb +27 -41
- data/spec/factories/users.rb +5 -14
- data/spec/features/browse_dashboard_files.rb +21 -0
- data/spec/features/browse_files.rb +31 -0
- data/spec/features/contact_form.rb +99 -0
- data/spec/features/display_dashboard.rb +46 -0
- data/spec/features/ingest_upload_files.rb +24 -0
- data/spec/features/users_spec.rb +25 -0
- data/spec/helpers/generic_file_helper_spec.rb +10 -3
- data/spec/helpers/sufia_helper_spec.rb +1 -1
- data/spec/lib/sufia/id_service_spec.rb +1 -15
- data/spec/models/audit_job_spec.rb +1 -15
- data/spec/models/batch_spec.rb +1 -15
- data/spec/models/batch_update_job_spec.rb +3 -16
- data/spec/models/characterize_job_spec.rb +4 -4
- data/spec/models/checksum_audit_log_spec.rb +1 -15
- data/spec/models/event_jobs_spec.rb +1 -15
- data/spec/models/file_content_datastream_spec.rb +5 -19
- data/spec/models/fits_datastream_spec.rb +1 -15
- data/spec/models/generic_file/web_form_spec.rb +34 -0
- data/spec/models/generic_file_spec.rb +11 -39
- data/spec/models/local_authority_spec.rb +3 -15
- data/spec/models/properties_datastream_spec.rb +1 -1
- data/spec/models/single_use_link_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/models/transcode_audio_job_spec.rb +1 -1
- data/spec/models/transcode_video_job_spec.rb +1 -1
- data/spec/models/trophy_spec.rb +1 -1
- data/spec/models/unzip_job_spec.rb +1 -15
- data/spec/models/user_spec.rb +1 -15
- data/spec/rake/sufia_fixtures_spec.rb +3 -17
- data/spec/routing/route_spec.rb +7 -21
- data/spec/spec_helper.rb +8 -20
- data/spec/support/features.rb +6 -0
- data/spec/support/features/session_helpers.rb +21 -0
- data/spec/support/lib/generators/test_app_generator.rb +4 -0
- data/spec/views/batch_edits/check_all_spec.rb +6 -4
- data/sufia-models/app/models/checksum_audit_log.rb +1 -15
- data/sufia-models/app/models/domain_term.rb +3 -15
- data/sufia-models/app/models/geo_names_resource.rb +1 -13
- data/sufia-models/app/models/local_authority.rb +12 -17
- data/sufia-models/app/models/local_authority_entry.rb +1 -15
- data/sufia-models/app/models/single_use_link.rb +2 -3
- data/sufia-models/app/models/trophy.rb +1 -1
- data/sufia-models/app/models/version_committer.rb +1 -15
- data/sufia-models/lib/sufia/models.rb +6 -2
- data/sufia-models/lib/sufia/models/engine.rb +1 -1
- data/sufia-models/lib/sufia/models/generic_file.rb +3 -0
- data/sufia-models/lib/sufia/models/generic_file/accessible_attributes.rb +87 -0
- data/sufia-models/lib/sufia/models/generic_file/permissions.rb +2 -1
- data/sufia-models/lib/sufia/models/generic_file/web_form.rb +4 -1
- data/sufia-models/lib/sufia/models/user.rb +9 -2
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/{lib → sufia-models/lib}/tasks/resque.rake +0 -0
- data/sufia-models/sufia-models.gemspec +13 -11
- data/sufia.gemspec +1 -3
- data/tasks/sufia-dev.rake +21 -10
- metadata +30 -84
- data/config/cucumber.yml +0 -8
- data/features/browse_dashboard_files.feature +0 -16
- data/features/browse_files.feature +0 -16
- data/features/contact_form.feature +0 -86
- data/features/display_dashboard.feature +0 -42
- data/features/ingest_upload_files.feature +0 -21
- data/features/step_definitions/edit_metadata_steps.rb +0 -89
- data/features/step_definitions/fixture_steps.rb +0 -35
- data/features/step_definitions/show_document_steps.rb +0 -103
- data/features/step_definitions/sufia.rb +0 -69
- data/features/step_definitions/user_steps.rb +0 -58
- data/features/step_definitions/web_steps.rb +0 -235
- data/features/support/cleanup.rb +0 -19
- data/features/support/env.rb +0 -90
- data/features/support/headless.rb +0 -26
- data/features/support/paths.rb +0 -101
- data/features/users.feature +0 -18
- data/spec/lib/sufia/role_mapper_spec.rb +0 -28
- data/spec/support/Gemfile +0 -24
- data/spec/views/single_user_link/download.html.erb_spec.rb +0 -5
- data/spec/views/single_user_link/generate_download.html.erb_spec.rb +0 -5
- data/spec/views/single_user_link/generate_show.html.erb_spec.rb +0 -5
- data/spec/views/single_user_link/show.html.erb_spec.rb +0 -5
- data/tasks/cucumber.rake +0 -72
@@ -1,18 +1,4 @@
|
|
1
|
-
|
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
|
-
|
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
|
-
|
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 =
|
61
|
+
repo = double("repo")
|
76
62
|
repo.stub(:config=>{})
|
77
63
|
f = File.new(fixture_path + '/world.png')
|
78
|
-
content =
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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(
|
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(
|
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 =
|
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 =
|
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
|
-
|
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']
|
data/spec/models/trophy_spec.rb
CHANGED
@@ -1,18 +1,4 @@
|
|
1
|
-
|
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
|
data/spec/models/user_spec.rb
CHANGED
@@ -1,18 +1,4 @@
|
|
1
|
-
|
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
|
-
|
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("
|
60
|
-
Rake.application.rake_require("
|
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
|
data/spec/routing/route_spec.rb
CHANGED
@@ -1,18 +1,4 @@
|
|
1
|
-
|
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',
|
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',
|
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',
|
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
|
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',
|
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',
|
124
|
+
{ post: '/users/bob135/unfollow' }.should route_to(controller: 'users', action: 'unfollow', id: 'bob135')
|
139
125
|
end
|
140
126
|
end
|
141
127
|
|