Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2d1178d316
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (24 sloc) 1.01 kb
require File.expand_path('../teststrap', __FILE__)
context 'Rack::ESI' do
__dirname__ = File.expand_path File.dirname(__FILE__)
root = Pathname.new File.join(__dirname__, 'fixtures')
opts = { :urls => ['/'], :root => root }
setup { ESI.new Static.new(App.new, opts), skip: /raw/, :poolsize => 1 }
context 'GET /raw.html' do
setup { MockRequest.new(topic).get '/raw.html' }
asserts('Content-Type') { topic.content_type }.equals 'text/html'
should('not be altered') { topic.body == root.join('raw.html').read }
end
context 'GET /index.html' do
setup { MockRequest.new(topic).get '/index.html' }
asserts('Content-Type') { topic.content_type }.equals 'text/html'
should('not have any ESI specific nodes') do
html(topic.body).
at('//e:*', 'e' => Rack::ESI::Processor::NAMESPACE).nil?
end
should('have meta replacement with content') do
not html(topic.body).
at("//meta[@name='replacement' and @content='content']").nil?
end
end
end
Jump to Line
Something went wrong with that request. Please try again.