Sha256: 2afa2de352aae55b2cc22cdb51a60219ec5d0841efc9f586bceff46fa33a4b92

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 Bytes

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-3.1.2 spec/lib/sufia/upload_complete_behavior_spec.rb
sufia-3.1.1 spec/lib/sufia/upload_complete_behavior_spec.rb
sufia-3.1.0 spec/lib/sufia/upload_complete_behavior_spec.rb