Sha256: 0a6702179469ead723d6cf23b3e057389724f8f7bde86ed1facc8d3c74b81bef
Contents?: true
Size: 1.37 KB
Versions: 17
Compression:
Stored size: 1.37 KB
Contents
require File.expand_path('../../helper', __FILE__) class SpecModeDummy Innate.node '/' def index 'Hello, World!' end def random rand.to_s end end describe 'Innate modes' do describe 'dev' do behaves_like :rack_test Innate.options.mode = :dev should 'handle GET request' do get('/').status. should == 200 last_response.headers. should == {'Content-Length' => '13', 'Content-Type' => 'text/html'} last_response.body. should == 'Hello, World!' end should 'handle HEAD requests by omitting body' do head('/').status. should == 200 last_response.headers. should == {'Content-Length' => '13', 'Content-Type' => 'text/html'} last_response.body. should == '' end end describe 'live' do behaves_like :rack_test Innate.options.mode = :live should 'handle GET request' do get('/').status. should == 200 last_response.headers. should == {'Content-Length' => '13', 'Content-Type' => 'text/html'} last_response.body. should == 'Hello, World!' end should 'handle HEAD requests by omitting body' do head('/').status. should == 200 last_response.headers. should == {'Content-Length' => '13', 'Content-Type' => 'text/html'} last_response.body. should == '' end end end
Version data entries
17 entries across 17 versions & 2 rubygems