Sha256: a07a5ed1cced4ceccbf9dc1ab4f35a65c7cb77864712e0079fc33655d0257f4f
Contents?: true
Size: 761 Bytes
Versions: 2
Compression:
Stored size: 761 Bytes
Contents
require 'spec/spec_helper' describe "esi cookie variable lookups" do it "should lookup a cookie variable" do vars = {'type' => 'user'} builder = Rack::Builder.new do use EsiForRack, {'/file/1' => 'resource'} run proc { |env| data = IO.read('spec/http_integration/fixtures/cookie/1.html') [200, {'Content-type' => 'text/html', 'Content-length' => data.size.to_s}, [data]] } end request = Rack::MockRequest.env_for("/?#{Rack::Utils.build_query(vars)}") request['HTTP_COOKIE'] = 'id=1' builder.call(request).last.should == ["<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body>resource</body></html>\n"] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
joshbuddy-esi-for-rack-0.0.1 | spec/http_integration/cookie_spec.rb |
joshbuddy-esi-for-rack-0.0.2 | spec/http_integration/cookie_spec.rb |