spec/mojito/rendering/status_codes_spec.rb in mojito-0.1.2 vs spec/mojito/rendering/status_codes_spec.rb in mojito-0.2.3

- old
+ new

@@ -1,15 +1,17 @@ # encoding: UTF-8 require 'simplecov' and SimpleCov.start do add_filter "spec/" + add_filter "lib/mojito/utils/rspec.rb" end require 'mojito' +require 'mojito/utils/rspec' describe Mojito::Rendering::StatusCodes do subject do - Mojito.base_application Mojito::Matchers::Path, Mojito::Rendering::StatusCodes do + Mojito::C.runtime_controller Mojito::R::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 @@ -18,9 +20,10 @@ 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' } + it { subject.get('/redirect').should respond_with(302, 'Location' => '/test') } +# it { subject.get('/redirect').status.should == 302 } +# it { subject.get('/redirect').headers['Location'].should == '/test' } end