aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-01 17:27:44 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-01 17:31:03 -0700
commite046f36824fcc164c284a13524c6b4153010a4e1 (patch)
tree08e7420dc8cb23db244fb46bb9878ac653d6eb39 /actionpack/test/new_base
parentb1d34b3aa42beaf6a9fb93f114aed8fe08ebd9db (diff)
downloadrails-e046f36824fcc164c284a13524c6b4153010a4e1.tar.gz
rails-e046f36824fcc164c284a13524c6b4153010a4e1.tar.bz2
rails-e046f36824fcc164c284a13524c6b4153010a4e1.zip
Renamed Base2 to Base and don't require old action_controller for new Base
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r--actionpack/test/new_base/base_test.rb6
-rw-r--r--actionpack/test/new_base/content_type_test.rb6
-rw-r--r--actionpack/test/new_base/render_action_test.rb6
-rw-r--r--actionpack/test/new_base/render_template_test.rb4
-rw-r--r--actionpack/test/new_base/render_test.rb4
-rw-r--r--actionpack/test/new_base/render_text_test.rb6
-rw-r--r--actionpack/test/new_base/test_helper.rb70
7 files changed, 19 insertions, 83 deletions
diff --git a/actionpack/test/new_base/base_test.rb b/actionpack/test/new_base/base_test.rb
index 27d1a7f026..a32653f128 100644
--- a/actionpack/test/new_base/base_test.rb
+++ b/actionpack/test/new_base/base_test.rb
@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
# Tests the controller dispatching happy path
module Dispatching
- class SimpleController < ActionController::Base2
+ class SimpleController < ActionController::Base
def index
render :text => "success"
end
@@ -69,9 +69,9 @@ module Dispatching
end
end
- class EmptyController < ActionController::Base2 ; end
+ class EmptyController < ActionController::Base ; end
module Submodule
- class ContainedEmptyController < ActionController::Base2 ; end
+ class ContainedEmptyController < ActionController::Base ; end
end
class ControllerClassTests < Test::Unit::TestCase
diff --git a/actionpack/test/new_base/content_type_test.rb b/actionpack/test/new_base/content_type_test.rb
index 10a28da496..a5c04e9cb6 100644
--- a/actionpack/test/new_base/content_type_test.rb
+++ b/actionpack/test/new_base/content_type_test.rb
@@ -1,7 +1,7 @@
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
module ContentType
- class BaseController < ActionController::Base2
+ class BaseController < ActionController::Base
def index
render :text => "Hello world!"
end
@@ -40,7 +40,7 @@ module ContentType
assert_header "Content-Type", "application/rss+xml; charset=utf-8"
end
- class ImpliedController < ActionController::Base2
+ class ImpliedController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
"content_type/implied/i_am_html_erb.html.erb" => "Hello world!",
"content_type/implied/i_am_xml_erb.xml.erb" => "<xml>Hello world!</xml>",
@@ -81,7 +81,7 @@ module ContentType
end
module Charset
- class BaseController < ActionController::Base2
+ class BaseController < ActionController::Base
def set_on_response_obj
response.charset = "utf-16"
render :text => "Hello world!"
diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb
index 37b83fb681..348d70381b 100644
--- a/actionpack/test/new_base/render_action_test.rb
+++ b/actionpack/test/new_base/render_action_test.rb
@@ -3,7 +3,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
module RenderAction
# This has no layout and it works
- class BasicController < ActionController::Base2
+ class BasicController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
"render_action/basic/hello_world.html.erb" => "Hello world!"
@@ -203,7 +203,7 @@ end
module RenderActionWithControllerLayout
- class BasicController < ActionController::Base2
+ class BasicController < ActionController::Base
self.view_paths = self.view_paths = [ActionView::Template::FixturePath.new(
"render_action_with_controller_layout/basic/hello_world.html.erb" => "Hello World!",
"layouts/render_action_with_controller_layout/basic.html.erb" => "With Controller Layout! <%= yield %> KTHXBAI"
@@ -266,7 +266,7 @@ end
module RenderActionWithBothLayouts
- class BasicController < ActionController::Base2
+ class BasicController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new({
"render_action_with_both_layouts/basic/hello_world.html.erb" => "Hello World!",
"layouts/application.html.erb" => "OHAI <%= yield %> KTHXBAI",
diff --git a/actionpack/test/new_base/render_template_test.rb b/actionpack/test/new_base/render_template_test.rb
index 63769df082..c09eeb1926 100644
--- a/actionpack/test/new_base/render_template_test.rb
+++ b/actionpack/test/new_base/render_template_test.rb
@@ -1,7 +1,7 @@
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
module RenderTemplate
- class WithoutLayoutController < ActionController::Base2
+ class WithoutLayoutController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
"test/basic.html.erb" => "Hello from basic.html.erb",
@@ -129,7 +129,7 @@ module RenderTemplate
end
module Compatibility
- class WithoutLayoutController < ActionController::CompatibleBase2
+ class WithoutLayoutController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
"test/basic.html.erb" => "Hello from basic.html.erb",
"shared.html.erb" => "Elastica"
diff --git a/actionpack/test/new_base/render_test.rb b/actionpack/test/new_base/render_test.rb
index 647aa01628..b1867fdcc2 100644
--- a/actionpack/test/new_base/render_test.rb
+++ b/actionpack/test/new_base/render_test.rb
@@ -1,7 +1,7 @@
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
module Render
- class BlankRenderController < ActionController::Base2
+ class BlankRenderController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
"render/blank_render/index.html.erb" => "Hello world!",
"render/blank_render/access_request.html.erb" => "The request: <%= request.method.to_s.upcase %>",
@@ -36,7 +36,7 @@ module Render
assert_status 200
end
- class DoubleRenderController < ActionController::Base2
+ class DoubleRenderController < ActionController::Base
def index
render :text => "hello"
render :text => "world"
diff --git a/actionpack/test/new_base/render_text_test.rb b/actionpack/test/new_base/render_text_test.rb
index d97c2ca0a6..39f2f7abbf 100644
--- a/actionpack/test/new_base/render_text_test.rb
+++ b/actionpack/test/new_base/render_text_test.rb
@@ -1,10 +1,10 @@
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")
-class ApplicationController < ActionController::Base2
+class ApplicationController < ActionController::Base
end
module RenderText
- class SimpleController < ActionController::Base2
+ class SimpleController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new]
def index
@@ -146,4 +146,4 @@ module RenderText
end
end
-ActionController::Base2.app_loaded! \ No newline at end of file
+ActionController::Base.app_loaded! \ No newline at end of file
diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb
index 6a71bd29c4..547eb1ef72 100644
--- a/actionpack/test/new_base/test_helper.rb
+++ b/actionpack/test/new_base/test_helper.rb
@@ -5,10 +5,7 @@ $:.unshift(File.dirname(__FILE__) + '/../lib')
require 'test/unit'
require 'active_support'
require 'active_support/test_case'
-require 'action_controller/new_base/base'
-require 'action_controller/new_base/renderer'
-require 'action_controller'
-require 'action_view/base'
+require 'action_view'
require 'fixture_template'
begin
@@ -34,67 +31,6 @@ module Rails
end
end
-module ActionController
- class Base2 < Http
- abstract!
-
- use AbstractController::Callbacks
- use AbstractController::Helpers
- use AbstractController::Logger
-
- use ActionController::HideActions
- use ActionController::UrlFor
- use ActionController::Renderer
- use ActionController::Layouts
-
- def self.inherited(klass)
- ::ActionController::Base2.subclasses << klass.to_s
- super
- end
-
- def self.subclasses
- @subclasses ||= []
- end
-
- def self.app_loaded!
- @subclasses.each do |subclass|
- subclass.constantize._write_layout_method
- end
- end
-
- def render(action = action_name, options = {})
- if action.is_a?(Hash)
- options, action = action, nil
- else
- options.merge! :action => action
- end
-
- super(options)
- end
-
- def render_to_body(options = {})
- options = {:template => options} if options.is_a?(String)
- super
- end
-
- def process_action
- ret = super
- render if response_body.nil?
- ret
- end
-
- def respond_to_action?(action_name)
- super || view_paths.find_by_parts?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path)
- end
- end
-
- class CompatibleBase2 < Base2
- abstract!
-
- use ActionController::Rails2Compatibility
- end
-end
-
# Temporary base class
class Rack::TestCase < ActiveSupport::TestCase
include Rack::Test::Methods
@@ -103,7 +39,7 @@ class Rack::TestCase < ActiveSupport::TestCase
ActionController::Base.session_options[:key] = "abc"
ActionController::Base.session_options[:secret] = ("*" * 30)
- controllers = ActionController::Base2.subclasses.map do |k|
+ controllers = ActionController::Base.subclasses.map do |k|
k.underscore.sub(/_controller$/, '')
end
@@ -171,7 +107,7 @@ class Rack::TestCase < ActiveSupport::TestCase
end
-class ::ApplicationController < ActionController::Base2
+class ::ApplicationController < ActionController::Base
end
class SimpleRouteCase < Rack::TestCase