-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from psu-stewardship/upload_path
Adding one location to define/ override where the upload redirects to af...
- Loading branch information
Showing
7 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Sufia | ||
module FilesController::UploadCompleteBehavior | ||
def upload_complete_path(batch_id) | ||
Sufia::Engine.routes.url_helpers.batch_edit_path(batch_id) | ||
end | ||
end # /FilesController::UploadCompleteBehavior | ||
end # /Sufia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "spec_helper" | ||
class UploadThing | ||
extend Sufia::FilesController::UploadCompleteBehavior | ||
end | ||
|
||
class UploadThingRedefine | ||
extend Sufia::FilesController::UploadCompleteBehavior | ||
def self.upload_complete_path(id) | ||
return "example.com" | ||
end | ||
|
||
end | ||
|
||
describe Sufia::FilesController::UploadCompleteBehavior do | ||
let (:test_id) {"123abc"} | ||
context "Not overridden" do | ||
it "respond with the batch edit path" do | ||
UploadThing.upload_complete_path(test_id).should == Sufia::Engine.routes.url_helpers.batch_edit_path(test_id) | ||
end | ||
end | ||
context "overriden path" do | ||
it "respond with the batch edit path" do | ||
UploadThingRedefine.upload_complete_path(test_id).should == "example.com" | ||
end | ||
end | ||
end |