Sha256: 0a4922d50b78e20d0b4d5d7e741c5be70d921bfdf4674ce8ea8088501af17c61

Contents?: true

Size: 742 Bytes

Versions: 11

Compression:

Stored size: 742 Bytes

Contents

shared_examples "a request handler" do
  let(:rackapp) { mock }
  let(:req)     { mock }
  let(:env)     { mock }
  let(:handler) { described_class.new }
  let(:mock_storage) do
    mock({
      :new => mock({
        :get_content => "content",
        :mime_type => "text/plain",
        :filename => "file",
        :url => "url"
      })
    })
  end
  before(:each) do
    Shutterbug::Configuration.instance.stub!(:storage => mock_storage)
  end

  it "should respond to regex" do
    handler.class.should respond_to :regex
    handler.class.regex.should be_kind_of Regexp
  end

  it "should respond to handle" do
    handler.should respond_to :handle
    rackapp.should_receive :response
    handler.handle(rackapp, req, env)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shutterbug-0.5.9 spec/shared_examples_for_handlers.rb
shutterbug-0.5.8 spec/shared_examples_for_handlers.rb
shutterbug-0.5.7 spec/shared_examples_for_handlers.rb
shutterbug-0.5.6 spec/shared_examples_for_handlers.rb
shutterbug-0.5.5 spec/shared_examples_for_handlers.rb
shutterbug-0.5.4 spec/shared_examples_for_handlers.rb
shutterbug-0.5.3 spec/shared_examples_for_handlers.rb
shutterbug-0.5.2 spec/shared_examples_for_handlers.rb
shutterbug-0.5.1 spec/shared_examples_for_handlers.rb
shutterbug-0.5.0 spec/shared_examples_for_handlers.rb
shutterbug-0.4.3 spec/shared_examples_for_handlers.rb