Sha256: 7b418a0317580722c23a63ae745d9966333cdfdde0ba39edadfbdaa3b484fef1

Contents?: true

Size: 388 Bytes

Versions: 10

Compression:

Stored size: 388 Bytes

Contents

require "spec_helper"

describe Rack::API, "Middlewares" do
   before do
    Rack::API.app do
      use ZOMGMiddleware

      version :v1 do
        use AwesomeMiddleware
        get("/") {}
      end
    end
  end

  it "sends custom headers" do
    get "/v1"
    last_response.headers["X-Awesome"].should == "U R Awesome"
    last_response.headers["X-ZOMG"].should == "ZOMG!"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rack-api-1.1.0 spec/rack-api/middlewares_spec.rb
rack-api-1.0.2 spec/rack-api/middlewares_spec.rb
rack-api-1.0.1 spec/rack-api/middlewares_spec.rb
rack-api-1.0.0 spec/rack-api/middlewares_spec.rb
rack-api-0.3.1 spec/rack-api/middlewares_spec.rb
rack-api-0.3.0 spec/rack-api/middlewares_spec.rb
rack-api-0.2.2 spec/rack-api/middlewares_spec.rb
rack-api-0.2.1 spec/rack-api/middlewares_spec.rb
rack-api-0.2.0 spec/rack-api/middlewares_spec.rb
rack-api-0.1.2 spec/rack-api/middlewares_spec.rb