Sha256: b1e0eda61e90e48648706b0e6faf8612c2dbd16dcb180f182092d7f6c731f421
Contents?: true
Size: 1.08 KB
Versions: 11
Compression:
Stored size: 1.08 KB
Contents
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 def self.destroy_complete_path(id) return "destroy.com" end end describe Sufia::FilesController::UploadCompleteBehavior do let (:test_id) {"123abc"} context "Not overridden" do it "respond with the batch edit path" do expect(UploadThing.upload_complete_path(test_id)).to eq(Sufia::Engine.routes.url_helpers.batch_edit_path(test_id)) end it "respond with the dashboard path" do expect(UploadThing.destroy_complete_path({})).to eq(Sufia::Engine.routes.url_helpers.dashboard_files_path) end end context "overriden path" do it "respond with the batch edit path" do expect(UploadThingRedefine.upload_complete_path(test_id)).to eq("example.com") end it "respond with the batch edit path" do expect(UploadThingRedefine.destroy_complete_path(test_id)).to eq("destroy.com") end end end
Version data entries
11 entries across 11 versions & 1 rubygems