test/support/routes.rb in deas-0.2.1 vs test/support/routes.rb in deas-0.3.0

- old
+ new

@@ -7,20 +7,29 @@ log_file_path = File.expand_path("../../../log/test.log", __FILE__) logger Logger.new(File.open(log_file_path, 'w')) verbose_logging true - get '/show', 'ShowHandler' - get '/halt', 'HaltHandler' - get '/error', 'ErrorHandler' - get '/with_layout', 'WithLayoutHandler' - get '/alt_with_layout', 'AlternateWithLayoutHandler' - get '/redirect', 'RedirectHandler' - get '/redirect_to', 'RedirectToHandler' - get '/set_session', 'SetSessionHandler' - get '/use_session', 'UseSessionHandler' + error do |exception| + case exception + when Sinatra::NotFound + halt 404, "Couldn't be found" + when Exception + halt 500, "Oops, something went wrong" + end + end + get '/show', 'ShowHandler' + get '/halt', 'HaltHandler' + get '/error', 'ErrorHandler' + get '/with_layout', 'WithLayoutHandler' + get '/alt_with_layout', 'AlternateWithLayoutHandler' + get '/redirect', 'RedirectHandler' + get '/redirect_to', 'RedirectToHandler' + post '/session', 'SetSessionHandler' + get '/session', 'UseSessionHandler' + end class ShowHandler include Deas::ViewHandler @@ -100,10 +109,10 @@ class SetSessionHandler include Deas::ViewHandler def run! session[:secret] = 'session_secret' - redirect_to '/use_session' + redirect_to '/session' end end class UseSessionHandler