aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2010-09-25 08:15:52 +0800
committerJosé Valim <jose.valim@gmail.com>2010-09-26 02:13:45 +0800
commit7fc1edd790a3f590a81991d4582ab567de5a3de0 (patch)
tree2e824123d5b02c050119127e45a522a94196e42d /actionpack/test
parentff3f55ee583743abf03a75d221216614e7ccd5e8 (diff)
downloadrails-7fc1edd790a3f590a81991d4582ab567de5a3de0.tar.gz
rails-7fc1edd790a3f590a81991d4582ab567de5a3de0.tar.bz2
rails-7fc1edd790a3f590a81991d4582ab567de5a3de0.zip
Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to Routing, Abstract Request/Response and Integration/IntegrationTest. All tests and docs were changed to ActionDispatch instead of ActionController.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb6
-rw-r--r--actionpack/test/activerecord/active_record_store_test.rb2
-rw-r--r--actionpack/test/controller/filters_test.rb3
-rw-r--r--actionpack/test/controller/flash_test.rb2
-rw-r--r--actionpack/test/controller/integration_test.rb12
-rw-r--r--actionpack/test/controller/rescue_test.rb2
-rw-r--r--actionpack/test/controller/routing_test.rb14
-rw-r--r--actionpack/test/controller/webservice_test.rb2
-rw-r--r--actionpack/test/dispatch/request/json_params_parsing_test.rb2
-rw-r--r--actionpack/test/dispatch/request/multipart_params_parsing_test.rb2
-rw-r--r--actionpack/test/dispatch/request/query_string_parsing_test.rb2
-rw-r--r--actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb2
-rw-r--r--actionpack/test/dispatch/request/xml_params_parsing_test.rb2
-rw-r--r--actionpack/test/dispatch/routing_test.rb6
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb6
-rw-r--r--actionpack/test/dispatch/session/mem_cache_store_test.rb2
-rw-r--r--actionpack/test/dispatch/show_exceptions_test.rb2
17 files changed, 34 insertions, 35 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 13f05651bc..3540af13ac 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -124,7 +124,7 @@ module ActiveSupport
match ':controller(/:action)'
end
- ActionController::IntegrationTest.app.routes.draw do
+ ActionDispatch::IntegrationTest.app.routes.draw do
match ':controller(/:action)'
end
end
@@ -163,9 +163,7 @@ class ActionDispatch::IntegrationTest < ActiveSupport::TestCase
setup do
@routes = SharedTestRoutes
end
-end
-class ActionController::IntegrationTest < ActiveSupport::TestCase
def self.build_app(routes = nil)
RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware|
middleware.use "ActionDispatch::ShowExceptions"
@@ -232,7 +230,7 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase
end
# Temporary base class
-class Rack::TestCase < ActionController::IntegrationTest
+class Rack::TestCase < ActionDispatch::IntegrationTest
def self.testing(klass = nil)
if klass
@testing = "/#{klass.name.underscore}".sub!(/_controller$/, '')
diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb
index dd43fa4810..f5811a1530 100644
--- a/actionpack/test/activerecord/active_record_store_test.rb
+++ b/actionpack/test/activerecord/active_record_store_test.rb
@@ -1,6 +1,6 @@
require 'active_record_unit'
-class ActiveRecordStoreTest < ActionController::IntegrationTest
+class ActiveRecordStoreTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def no_session_access
head :ok
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index d0fd9e8e46..cf4a461622 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -452,13 +452,14 @@ class FilterTest < ActionController::TestCase
render :text => 'hello world'
end
end
+
def test_sweeper_should_not_block_rendering
response = test_process(SweeperTestController)
assert_equal 'hello world', response.body
end
def test_before_method_of_sweeper_should_always_return_true
- sweeper = ActionController::Caching::Sweeper.send(:new)
+ sweeper = ActionController::Caching::Sweeper.send(:new)
assert sweeper.before(TestController.new)
end
diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb
index 6c411d8997..3569a2f213 100644
--- a/actionpack/test/controller/flash_test.rb
+++ b/actionpack/test/controller/flash_test.rb
@@ -209,7 +209,7 @@ class FlashTest < ActionController::TestCase
end
end
-class FlashIntegrationTest < ActionController::IntegrationTest
+class FlashIntegrationTest < ActionDispatch::IntegrationTest
SessionKey = '_myapp_session'
SessionSecret = 'b3c631c314c0bbca50c1b2843150fe33'
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 343cffdf7f..4ff39fb76c 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -8,7 +8,7 @@ class SessionTest < Test::Unit::TestCase
}
def setup
- @session = ActionController::Integration::Session.new(StubApp)
+ @session = ActionDispatch::Integration::Session.new(StubApp)
end
def test_https_bang_works_and_sets_truth_by_default
@@ -167,7 +167,7 @@ end
class IntegrationTestTest < Test::Unit::TestCase
def setup
- @test = ::ActionController::IntegrationTest.new(:default_test)
+ @test = ::ActionDispatch::IntegrationTest.new(:default_test)
@test.class.stubs(:fixture_table_names).returns([])
@session = @test.open_session
end
@@ -202,7 +202,7 @@ end
# Tests that integration tests don't call Controller test methods for processing.
# Integration tests have their own setup and teardown.
-class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest
+class IntegrationTestUsesCorrectClass < ActionDispatch::IntegrationTest
def self.fixture_table_names
[]
end
@@ -218,7 +218,7 @@ class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest
end
end
-class IntegrationProcessTest < ActionController::IntegrationTest
+class IntegrationProcessTest < ActionDispatch::IntegrationTest
class IntegrationController < ActionController::Base
def get
respond_to do |format|
@@ -439,7 +439,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest
end
end
-class MetalIntegrationTest < ActionController::IntegrationTest
+class MetalIntegrationTest < ActionDispatch::IntegrationTest
include SharedTestRoutes.url_helpers
class Poller
@@ -476,7 +476,7 @@ class MetalIntegrationTest < ActionController::IntegrationTest
end
end
-class ApplicationIntegrationTest < ActionController::IntegrationTest
+class ApplicationIntegrationTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def index
render :text => "index"
diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb
index 04eedf3295..cefbc548c0 100644
--- a/actionpack/test/controller/rescue_test.rb
+++ b/actionpack/test/controller/rescue_test.rb
@@ -311,7 +311,7 @@ class RescueControllerTest < ActionController::TestCase
end
end
-class RescueTest < ActionController::IntegrationTest
+class RescueTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class RecordInvalid < StandardError
def message
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index bb990586f7..ecfa13d4ba 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -10,12 +10,12 @@ class MilestonesController < ActionController::Base
def rescue_action(e) raise e end
end
-ROUTING = ActionController::Routing
+ROUTING = ActionDispatch::Routing
# See RFC 3986, section 3.3 for allowed path characters.
class UriReservedCharactersRoutingTest < Test::Unit::TestCase
def setup
- @set = ActionController::Routing::RouteSet.new
+ @set = ActionDispatch::Routing::RouteSet.new
@set.draw do
match ':controller/:action/:variable/*additional'
end
@@ -71,7 +71,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
attr_reader :rs
def setup
- @rs = ::ActionController::Routing::RouteSet.new
+ @rs = ::ActionDispatch::Routing::RouteSet.new
end
def teardown
@@ -103,7 +103,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
def test_time_recognition
# We create many routes to make situation more realistic
- @rs = ::ActionController::Routing::RouteSet.new
+ @rs = ::ActionDispatch::Routing::RouteSet.new
@rs.draw {
root :to => "search#new", :as => "frontpage"
resources :videos do
@@ -581,7 +581,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_routes_changed_correctly_after_clear
- rs = ::ActionController::Routing::RouteSet.new
+ rs = ::ActionDispatch::Routing::RouteSet.new
rs.draw do
match 'ca' => 'ca#aa'
match 'cb' => 'cb#ab'
@@ -1516,7 +1516,7 @@ class RackMountIntegrationTests < ActiveSupport::TestCase
end
match '/blog(/:year(/:month(/:day)))' => 'posts#show_date',
- :constraints => {
+ :constraints => {
:year => /(19|20)\d\d/,
:month => /[01]?\d/,
:day => /[0-3]?\d/
@@ -1559,7 +1559,7 @@ class RackMountIntegrationTests < ActiveSupport::TestCase
}
def setup
- @routes = ActionController::Routing::RouteSet.new
+ @routes = ActionDispatch::Routing::RouteSet.new
@routes.draw(&Mapping)
end
diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb
index cd021c3b20..5564775a48 100644
--- a/actionpack/test/controller/webservice_test.rb
+++ b/actionpack/test/controller/webservice_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class WebServiceTest < ActionController::IntegrationTest
+class WebServiceTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def assign_parameters
if params[:full]
diff --git a/actionpack/test/dispatch/request/json_params_parsing_test.rb b/actionpack/test/dispatch/request/json_params_parsing_test.rb
index b6dee77203..34db7a4c66 100644
--- a/actionpack/test/dispatch/request/json_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/json_params_parsing_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class JsonParamsParsingTest < ActionController::IntegrationTest
+class JsonParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters
diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
index e701185b61..1ae514ebf7 100644
--- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class MultipartParamsParsingTest < ActionController::IntegrationTest
+class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters
diff --git a/actionpack/test/dispatch/request/query_string_parsing_test.rb b/actionpack/test/dispatch/request/query_string_parsing_test.rb
index 8d67df433c..f6a1475d04 100644
--- a/actionpack/test/dispatch/request/query_string_parsing_test.rb
+++ b/actionpack/test/dispatch/request/query_string_parsing_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class QueryStringParsingTest < ActionController::IntegrationTest
+class QueryStringParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_query_parameters
diff --git a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
index b179f08f4e..04a0fb6f34 100644
--- a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class UrlEncodedParamsParsingTest < ActionController::IntegrationTest
+class UrlEncodedParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters, :last_request_type
diff --git a/actionpack/test/dispatch/request/xml_params_parsing_test.rb b/actionpack/test/dispatch/request/xml_params_parsing_test.rb
index 9d0695bf64..16669614d6 100644
--- a/actionpack/test/dispatch/request/xml_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/xml_params_parsing_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
-class XmlParamsParsingTest < ActionController::IntegrationTest
+class XmlParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 3daabf7a64..bdef04efc6 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -463,7 +463,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
- class TestAltApp < ActionController::IntegrationTest
+ class TestAltApp < ActionDispatch::IntegrationTest
class AltRequest
def initialize(env)
@env = env
@@ -2184,7 +2184,7 @@ private
end
end
-class TestAppendingRoutes < ActionController::IntegrationTest
+class TestAppendingRoutes < ActionDispatch::IntegrationTest
def simple_app(resp)
lambda { |e| [ 200, { 'Content-Type' => 'text/plain' }, [resp] ] }
end
@@ -2218,7 +2218,7 @@ class TestAppendingRoutes < ActionController::IntegrationTest
end
end
-class TestDefaultScope < ActionController::IntegrationTest
+class TestDefaultScope < ActionDispatch::IntegrationTest
module ::Blog
class PostsController < ActionController::Base
def index
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index dd580f0692..b436fb5518 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -1,7 +1,7 @@
require 'abstract_unit'
require 'stringio'
-class CookieStoreTest < ActionController::IntegrationTest
+class CookieStoreTest < ActionDispatch::IntegrationTest
SessionKey = '_myapp_session'
SessionSecret = 'b3c631c314c0bbca50c1b2843150fe33'
@@ -105,7 +105,7 @@ class CookieStoreTest < ActionController::IntegrationTest
assert_equal 'foo: nil', response.body
end
end
-
+
def test_does_not_set_secure_cookies_over_http
with_test_route_set(:secure => true) do
get '/set_session_value'
@@ -113,7 +113,7 @@ class CookieStoreTest < ActionController::IntegrationTest
assert_equal nil, headers['Set-Cookie']
end
end
-
+
def test_does_set_secure_cookies_over_https
with_test_route_set(:secure => true) do
get '/set_session_value', nil, 'HTTPS' => 'on'
diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb
index ab10d5fd3a..8502bc547b 100644
--- a/actionpack/test/dispatch/session/mem_cache_store_test.rb
+++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb
@@ -1,7 +1,7 @@
require 'abstract_unit'
# You need to start a memcached server inorder to run these tests
-class MemCacheStoreTest < ActionController::IntegrationTest
+class MemCacheStoreTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def no_session_access
head :ok
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb
index 4966527f4d..5b181600e8 100644
--- a/actionpack/test/dispatch/show_exceptions_test.rb
+++ b/actionpack/test/dispatch/show_exceptions_test.rb
@@ -14,7 +14,7 @@ module ActionDispatch
end
end
-class ShowExceptionsTest < ActionController::IntegrationTest
+class ShowExceptionsTest < ActionDispatch::IntegrationTest
Boomer = lambda do |env|
req = ActionDispatch::Request.new(env)
case req.path