test/support/routes.rb in deas-0.29.0 vs test/support/routes.rb in deas-0.30.0

- old
+ new

@@ -30,18 +30,12 @@ get '/error', 'ErrorHandler' get '/redirect', 'RedirectHandler' post '/session', 'SetSessionHandler' get '/session', 'UseSessionHandler' - get '/with_layout', 'WithLayoutHandler' - get '/haml_with_layout', 'HamlWithLayoutHandler' - get '/with_haml_layout', 'WithHamlLayoutHandler' - get '/haml_with_haml_layout', 'HamlWithHamlLayoutHandler' - get '/partial.html', 'PartialHandler' + get '/handler/tests', 'HandlerTestsHandler' - get '/handler/tests.json', 'HandlerTestsHandler' - redirect '/route_redirect', '/somewhere' redirect('/:prefix/redirect'){ "/#{params['prefix']}/somewhere" } end @@ -70,11 +64,11 @@ def init! @message = params['message'] end def run! - render 'show' + @message end end class ShowHtmlHandler @@ -94,21 +88,20 @@ class ShowLatinJsonHandler include Deas::ViewHandler def run! content_type :json, :charset => 'latin1' - render 'show_json' end end class ShowTextHandler include Deas::ViewHandler def run! hdrs = {'Content-Type' => 'text/plain'} - halt 200, hdrs, render('show.json') + halt 200, hdrs, '' end end class ShowHeadersTextHandler @@ -137,57 +130,10 @@ raise 'test' end end -class WithLayoutHandler - include Deas::ViewHandler - layouts 'layout1', 'layout2', 'layout3' - - def run! - render 'with_layout' - end - -end - -class HamlWithLayoutHandler - include Deas::ViewHandler - layouts 'layout1' - - def run! - render 'haml_with_layout' - end - -end - -class WithHamlLayoutHandler - include Deas::ViewHandler - layouts 'haml_layout1' - - def run! - render 'with_layout' - end - -end - -class HamlWithHamlLayoutHandler - include Deas::ViewHandler - layouts 'haml_layout1' - - def run! - render 'haml_with_layout' - end - -end - -class PartialHandler - include Deas::ViewHandler - - def run!; partial '_info', :info => 'some-info'; end - -end - class RedirectHandler include Deas::ViewHandler def run! redirect 'http://google.com', 'wrong place, buddy' @@ -232,10 +178,9 @@ rescue Exception => e end end def run! - require 'multi_json' - [200, {}, MultiJson.encode(@data)] + [200, {}, @data.inspect] end end