Permalink
Browse files

moved tests to a more visible spot in the test suite

  • Loading branch information...
1 parent 26babf2 commit 6b6836af7c63f37ca7769e7cd60cdc79dbe0f40d @witlessbird witlessbird committed Mar 20, 2013
Showing with 24 additions and 24 deletions.
  1. +24 −24 src/test/lib/url_constrained_cookie_store_test.rb
View
48 src/test/lib/url_constrained_cookie_store_test.rb
@@ -14,19 +14,6 @@
require 'minitest_helper'
require File.expand_path('../../../lib/katello/url_constrained_cookie_store', __FILE__)
-class RoutedRackApp
- attr_reader :routes
-
- def initialize(routes, &blk)
- @routes = routes
- @stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
- end
-
- def call(env)
- @stack.call(env)
- end
-end
-
class UrlConstrainedCookieStoreTest < ActionController::IntegrationTest
SessionKey = '_test_session'
SessionSecret = '16a7078c778fb1e28d062c6d1a26e864'
@@ -35,16 +22,6 @@ class UrlConstrainedCookieStoreTest < ActionController::IntegrationTest
SignedBar = Verifier.generate(:foo => "bar", :created_at => (Time.now - 2.minute),
:session_id => ActiveSupport::SecureRandom.hex(16))
- class TestController < ActionController::Base
- def no_expiration
- render :text => session[:session_id]
- end
-
- def with_expiration
- render :text => session[:session_id]
- end
- end
-
def test_doesnt_update_expiraton_date_for_excluded_urls
with_test_route_set(:expire_after => 1.minute, :expiration_exceptions => "/no_expiration") do
cookies[SessionKey] = SignedBar
@@ -69,6 +46,16 @@ def get(path, parameters = nil, env = {})
super
end
+ class TestController < ActionController::Base
+ def no_expiration
+ render :text => session[:session_id]
+ end
+
+ def with_expiration
+ render :text => session[:session_id]
+ end
+ end
+
def with_test_route_set(options = {})
with_routing do |set|
set.draw do
@@ -97,4 +84,17 @@ def build_app(routes = nil)
yield(middleware) if block_given?
end
end
-end
+end
+
+class RoutedRackApp
+ attr_reader :routes
+
+ def initialize(routes, &blk)
+ @routes = routes
+ @stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
+ end
+
+ def call(env)
+ @stack.call(env)
+ end
+end

0 comments on commit 6b6836a

Please sign in to comment.