test/api_test.rb in helmet-0.1.3 vs test/api_test.rb in helmet-0.2.0
- old
+ new
@@ -1,12 +1,14 @@
require File.join(File.dirname(__FILE__), 'test_helper')
require 'uri'
class Simple < Helmet::API
+
+ use Rack::Session::Cookie, :secret => 'remove_security_warning'
- before /\/x\w*$/ do
+ before '/xx' do
halt 'filtered!'
end
get '/' do
'get'
@@ -21,10 +23,14 @@
end
delete '/' do
'delete'
end
+
+ get '/raise' do
+ raise 'Error'
+ end
get '/redirect' do
redirect '/redirected'
end
end
@@ -84,7 +90,15 @@
uri = URI.parse(c.response_header['LOCATION'])
assert_equal '/redirected', uri.path
end
end
end
+
+ # def test_raise
+ # with_api(Simple) do
+ # get_request({:path => '/raise'}, @err) do |c|
+ # assert_equal 'get', c.response
+ # end
+ # end
+ # end
end