test/helper.rb in shield-0.1.0.rc1 vs test/helper.rb in shield-0.1.0
- old
+ new
@@ -2,9 +2,21 @@
require "shield"
require "cutest"
require "rack/test"
require "cuba"
+require "sinatra/base"
class Cutest::Scope
include Rack::Test::Methods
-end
\ No newline at end of file
+
+ def assert_redirected_to(path)
+ unless last_response.status == 302
+ flunk
+ end
+ assert_equal path, URI(last_response.headers["Location"]).path
+ end
+
+ def session
+ last_request.env["rack.session"]
+ end
+end