Sha256: 577f3faed4a9a47bc2dcf597e1e88025e55d7a83d1a1354e71e4312e4f2b69fe

Contents?: true

Size: 562 Bytes

Versions: 8

Compression:

Stored size: 562 Bytes

Contents

require "spec_helper"

describe Simple::Httpd do
  describe "CORS headers" do
    it "returns CORS headers on dynamic responses" do
      http.get "/"
      expect(http.response.headers.keys).to include("access-control-allow-origin")
    end

    it "sends proper headers in all request methods" do
      verbs = [ :get, :post, :put, :delete, :options, :head ]
      verbs.each do |verb|
      http.send verb, "/info/inspect?qux"

      expect_response 200
      expect(http.response.headers.keys).to include("access-control-allow-origin")
end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
simple-httpd-0.4.3 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.4.2 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.4.1 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.4.0 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.3.5 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.3.4 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.3.3 spec/simple/httpd/base_controller/httpd_cors_spec.rb
simple-httpd-0.3.1 spec/simple/httpd/base_controller/httpd_cors_spec.rb