Sha256: 992f8028ae2da9ef6838b2231cbf8155de663da5c884bcba54afea9b7aa2f445
Contents?: true
Size: 828 Bytes
Versions: 2
Compression:
Stored size: 828 Bytes
Contents
# encoding: UTF-8 require 'simplecov' and SimpleCov.start do add_filter "spec/" end require 'mojito' describe Mojito::Rendering::StatusCodes do subject do Mojito.base_application Mojito::Matchers::Path, Mojito::Rendering::StatusCodes do on 'ok' do ok! end on 'not_found' do not_found! end on 'internal_server_error' do internal_server_error! end on 'unavailable' do unavailable! end on 'redirect' do redirect! '/test' end end.mock_request end it { subject.get('/ok').status.should == 200 } it { subject.get('/not_found').status.should == 404 } it { subject.get('/internal_server_error').status.should == 500 } it { subject.get('/unavailable').status.should == 503 } it { subject.get('/redirect').status.should == 302 } it { subject.get('/redirect').headers['Location'].should == '/test' } end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mojito-0.1.2 | spec/mojito/rendering/status_codes_spec.rb |
mojito-0.1.1 | spec/mojito/rendering/status_codes_spec.rb |