Skip to content
Browse files

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.
  • Loading branch information...
1 parent ff3f55e commit 7fc1edd790a3f590a81991d4582ab567de5a3de0 @carlosantoniodasilva carlosantoniodasilva committed with josevalim Sep 25, 2010
Showing with 47 additions and 58 deletions.
  1. +0 −5 actionpack/lib/action_controller.rb
  2. +0 −3 actionpack/lib/action_controller/deprecated.rb
  3. +0 −2 actionpack/lib/action_controller/deprecated/integration_test.rb
  4. +0 −1 actionpack/lib/action_controller/deprecated/performance_test.rb
  5. +1 −1 actionpack/lib/action_controller/metal/http_authentication.rb
  6. +1 −1 actionpack/lib/action_controller/test_case.rb
  7. +1 −0 actionpack/lib/action_dispatch.rb
  8. +2 −2 actionpack/lib/action_dispatch/testing/integration.rb
  9. +2 −4 actionpack/test/abstract_unit.rb
  10. +1 −1 actionpack/test/activerecord/active_record_store_test.rb
  11. +2 −1 actionpack/test/controller/filters_test.rb
  12. +1 −1 actionpack/test/controller/flash_test.rb
  13. +6 −6 actionpack/test/controller/integration_test.rb
  14. +1 −1 actionpack/test/controller/rescue_test.rb
  15. +7 −7 actionpack/test/controller/routing_test.rb
  16. +1 −1 actionpack/test/controller/webservice_test.rb
  17. +1 −1 actionpack/test/dispatch/request/json_params_parsing_test.rb
  18. +1 −1 actionpack/test/dispatch/request/multipart_params_parsing_test.rb
  19. +1 −1 actionpack/test/dispatch/request/query_string_parsing_test.rb
  20. +1 −1 actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
  21. +1 −1 actionpack/test/dispatch/request/xml_params_parsing_test.rb
  22. +3 −3 actionpack/test/dispatch/routing_test.rb
  23. +3 −3 actionpack/test/dispatch/session/cookie_store_test.rb
  24. +1 −1 actionpack/test/dispatch/session/mem_cache_store_test.rb
  25. +1 −1 actionpack/test/dispatch/show_exceptions_test.rb
  26. +4 −4 railties/guides/source/testing.textile
  27. +1 −1 railties/lib/rails/test_help.rb
  28. +2 −2 railties/test/application/console_test.rb
  29. +1 −1 railties/test/application/test_test.rb
View
5 actionpack/lib/action_controller.rb
@@ -34,11 +34,6 @@ module ActionController
autoload :UrlFor
end
- autoload :Integration, 'action_controller/deprecated/integration_test'
- autoload :IntegrationTest, 'action_controller/deprecated/integration_test'
- autoload :PerformanceTest, 'action_controller/deprecated/performance_test'
- autoload :UrlWriter, 'action_controller/deprecated'
- autoload :Routing, 'action_controller/deprecated'
autoload :TestCase, 'action_controller/test_case'
eager_autoload do
View
3 actionpack/lib/action_controller/deprecated.rb
@@ -1,3 +0,0 @@
-ActionController::AbstractRequest = ActionController::Request = ActionDispatch::Request
-ActionController::AbstractResponse = ActionController::Response = ActionDispatch::Response
-ActionController::Routing = ActionDispatch::Routing
View
2 actionpack/lib/action_controller/deprecated/integration_test.rb
@@ -1,2 +0,0 @@
-ActionController::Integration = ActionDispatch::Integration
-ActionController::IntegrationTest = ActionDispatch::IntegrationTest
View
1 actionpack/lib/action_controller/deprecated/performance_test.rb
@@ -1 +0,0 @@
-ActionController::PerformanceTest = ActionDispatch::PerformanceTest
View
2 actionpack/lib/action_controller/metal/http_authentication.rb
@@ -417,7 +417,7 @@ def authenticate(controller, &login_procedure)
# Authorization: Token token="abc", nonce="def"
# Then the returned token is "abc", and the options is {:nonce => "def"}
#
- # request - ActionController::Request instance with the current headers.
+ # request - ActionDispatch::Request instance with the current headers.
#
# Returns an Array of [String, Hash] if a token is present.
# Returns nil if no token is found.
View
2 actionpack/lib/action_controller/test_case.rb
@@ -200,7 +200,7 @@ def exists?; true; end
# Superclass for ActionController functional tests. Functional tests allow you to
# test a single controller action per test method. This should not be confused with
- # integration tests (see ActionController::IntegrationTest), which are more like
+ # integration tests (see ActionDispatch::IntegrationTest), which are more like
# "stories" that can involve multiple controllers and multiple actions (i.e. multiple
# different HTTP requests).
#
View
1 actionpack/lib/action_dispatch.rb
@@ -85,6 +85,7 @@ module Session
autoload_under 'testing' do
autoload :Assertions
autoload :Integration
+ autoload :IntegrationTest, 'action_dispatch/testing/integration'
autoload :PerformanceTest
autoload :TestProcess
autoload :TestRequest
View
4 actionpack/lib/action_dispatch/testing/integration.rb
@@ -385,7 +385,7 @@ def method_missing(sym, *args, &block)
#
# require "test_helper"
#
- # class ExampleTest < ActionController::IntegrationTest
+ # class ExampleTest < ActionDispatch::IntegrationTest
# fixtures :people
#
# def test_login
@@ -409,7 +409,7 @@ def method_missing(sym, *args, &block)
#
# require "test_helper"
#
- # class AdvancedTest < ActionController::IntegrationTest
+ # class AdvancedTest < ActionDispatch::IntegrationTest
# fixtures :people, :rooms
#
# def test_login_and_speak
View
6 actionpack/test/abstract_unit.rb
@@ -124,7 +124,7 @@ class TestCase
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 @@ def with_autoload_path(path)
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$/, '')
View
2 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
View
3 actionpack/test/controller/filters_test.rb
@@ -452,13 +452,14 @@ def show
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
View
2 actionpack/test/controller/flash_test.rb
@@ -209,7 +209,7 @@ def test_redirect_to_with_other_flashes
end
end
-class FlashIntegrationTest < ActionController::IntegrationTest
+class FlashIntegrationTest < ActionDispatch::IntegrationTest
SessionKey = '_myapp_session'
SessionSecret = 'b3c631c314c0bbca50c1b2843150fe33'
View
12 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 @@ def test_xml_http_request_override_accept
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 @@ def method_missing(name, *args)
# 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 @@ def test_integration_methods_called
end
end
-class IntegrationProcessTest < ActionController::IntegrationTest
+class IntegrationProcessTest < ActionDispatch::IntegrationTest
class IntegrationController < ActionController::Base
def get
respond_to do |format|
@@ -439,7 +439,7 @@ def with_test_route_set
end
end
-class MetalIntegrationTest < ActionController::IntegrationTest
+class MetalIntegrationTest < ActionDispatch::IntegrationTest
include SharedTestRoutes.url_helpers
class Poller
@@ -476,7 +476,7 @@ def test_generate_url_without_controller
end
end
-class ApplicationIntegrationTest < ActionController::IntegrationTest
+class ApplicationIntegrationTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def index
render :text => "index"
View
2 actionpack/test/controller/rescue_test.rb
@@ -311,7 +311,7 @@ def test_block_rescue_handler_with_argument_as_string
end
end
-class RescueTest < ActionController::IntegrationTest
+class RescueTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class RecordInvalid < StandardError
def message
View
14 actionpack/test/controller/routing_test.rb
@@ -10,12 +10,12 @@ def index() head :ok end
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 @@ def test_ignores_leading_slash
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 @@ def test_failed_constraints_raises_exception_with_violated_constraints
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
View
2 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]
View
2 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
View
2 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
View
2 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
View
2 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
View
2 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
View
6 actionpack/test/dispatch/routing_test.rb
@@ -463,7 +463,7 @@ def self.matches?(request)
end
end
- class TestAltApp < ActionController::IntegrationTest
+ class TestAltApp < ActionDispatch::IntegrationTest
class AltRequest
def initialize(env)
@env = env
@@ -2184,7 +2184,7 @@ def expected_redirect_body(url)
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 @@ def test_missing_routes_are_still_missing
end
end
-class TestDefaultScope < ActionController::IntegrationTest
+class TestDefaultScope < ActionDispatch::IntegrationTest
module ::Blog
class PostsController < ActionController::Base
def index
View
6 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,15 +105,15 @@ def test_disregards_tampered_sessions
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'
assert_response :success
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'
View
2 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
View
2 actionpack/test/dispatch/show_exceptions_test.rb
@@ -14,7 +14,7 @@ def logger
end
end
-class ShowExceptionsTest < ActionController::IntegrationTest
+class ShowExceptionsTest < ActionDispatch::IntegrationTest
Boomer = lambda do |env|
req = ActionDispatch::Request.new(env)
case req.path
View
8 railties/guides/source/testing.textile
@@ -613,7 +613,7 @@ Here's what a freshly-generated integration test looks like:
<ruby>
require 'test_helper'
-class UserFlowsTest < ActionController::IntegrationTest
+class UserFlowsTest < ActionDispatch::IntegrationTest
fixtures :all
# Replace this with your real tests.
@@ -623,7 +623,7 @@ class UserFlowsTest < ActionController::IntegrationTest
end
</ruby>
-Integration tests inherit from +ActionController::IntegrationTest+. This makes available some additional helpers to use in your integration tests. Also you need to explicitly include the fixtures to be made available to the test.
+Integration tests inherit from +ActionDispatch::IntegrationTest+. This makes available some additional helpers to use in your integration tests. Also you need to explicitly include the fixtures to be made available to the test.
h4. Helpers Available for Integration Tests
@@ -649,7 +649,7 @@ A simple integration test that exercises multiple controllers:
<ruby>
require 'test_helper'
-class UserFlowsTest < ActionController::IntegrationTest
+class UserFlowsTest < ActionDispatch::IntegrationTest
fixtures :users
test "login and browse site" do
@@ -677,7 +677,7 @@ Here's an example of multiple sessions and custom DSL in an integration test
<ruby>
require 'test_helper'
-class UserFlowsTest < ActionController::IntegrationTest
+class UserFlowsTest < ActionDispatch::IntegrationTest
fixtures :users
test "login and browse site" do
View
2 railties/lib/rails/test_help.rb
@@ -21,7 +21,7 @@ class ActiveSupport::TestCase
self.fixture_path = "#{Rails.root}/test/fixtures/"
end
- ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
def create_fixtures(*table_names, &block)
Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block)
View
4 railties/test/application/console_test.rb
@@ -17,14 +17,14 @@ def test_app_method_should_return_integration_session
load_environment
console_session = app
assert_not_nil console_session
- assert_instance_of ActionController::Integration::Session, console_session
+ assert_instance_of ActionDispatch::Integration::Session, console_session
end
def test_new_session_should_return_integration_session
load_environment
session = new_session
assert_not_nil session
- assert_instance_of ActionController::Integration::Session, session
+ assert_instance_of ActionDispatch::Integration::Session, session
end
def test_reload_should_fire_preparation_callbacks
View
2 railties/test/application/test_test.rb
@@ -53,7 +53,7 @@ class PostsController < ActionController::Base
app_file 'test/integration/posts_test.rb', <<-RUBY
require 'test_helper'
- class PostsTest < ActionController::IntegrationTest
+ class PostsTest < ActionDispatch::IntegrationTest
def test_index
get '/posts'
assert_response :success

0 comments on commit 7fc1edd

Please sign in to comment.
Something went wrong with that request. Please try again.