Skip to content

Commit

Permalink
Redraw default routes on all internal integration tests. We don't nee…
Browse files Browse the repository at this point in the history
…d SimpleRouteCase anymore
  • Loading branch information
josh committed Oct 4, 2009
1 parent 8287a11 commit 61411f2
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 41 deletions.
18 changes: 8 additions & 10 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -81,6 +81,12 @@ def with_routing(&block)
ActionController::Routing.const_set(:Routes, real_routes) if real_routes
self.class.app = self.class.build_app
end

setup do
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
end
end
end

module ActionView
Expand Down Expand Up @@ -160,9 +166,9 @@ def self.inherited(klass)
super
end
end

Base.view_paths = FIXTURE_LOAD_PATH

class TestCase
include TestProcess

Expand Down Expand Up @@ -214,11 +220,3 @@ def assert_template(options = {}, message = nil)
end
end
end

class SimpleRouteCase < Rack::TestCase
setup do
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
end
end
end
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/base_test.rb
Expand Up @@ -26,7 +26,7 @@ module Submodule
class ContainedEmptyController < ActionController::Base ; end
end

class BaseTest < SimpleRouteCase
class BaseTest < Rack::TestCase
# :api: plugin
test "simple dispatching" do
get "/dispatching/simple/index"
Expand Down
Expand Up @@ -9,7 +9,7 @@ class BasicController < ActionController::Base
)]
end

class TestContentNegotiation < SimpleRouteCase
class TestContentNegotiation < Rack::TestCase
test "A */* Accept header will return HTML" do
get "/content_negotiation/basic/hello", {}, "HTTP_ACCEPT" => "*/*"
assert_body "Hello world */*!"
Expand Down
6 changes: 3 additions & 3 deletions actionpack/test/controller/new_base/content_type_test.rb
Expand Up @@ -44,7 +44,7 @@ def set_as_nil_on_response_obj
end
end

class ExplicitContentTypeTest < SimpleRouteCase
class ExplicitContentTypeTest < Rack::TestCase
test "default response is HTML and UTF8" do
get "/content_type/base"

Expand All @@ -67,7 +67,7 @@ class ExplicitContentTypeTest < SimpleRouteCase
end
end

class ImpliedContentTypeTest < SimpleRouteCase
class ImpliedContentTypeTest < Rack::TestCase
test "sets Content-Type as text/html when rendering *.html.erb" do
get "/content_type/implied/i_am_html_erb"

Expand All @@ -93,7 +93,7 @@ class ImpliedContentTypeTest < SimpleRouteCase
end
end

class ExplicitCharsetTest < SimpleRouteCase
class ExplicitCharsetTest < Rack::TestCase
test "setting the charset of the response directly on the response object" do
get "/content_type/charset/set_on_response_obj"

Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/etag_test.rb
Expand Up @@ -16,7 +16,7 @@ def with_layout
end
end

class EtagTest < SimpleRouteCase
class EtagTest < Rack::TestCase
describe "Rendering without any special etag options returns an etag that is an MD5 hash of its text"

test "an action without a layout" do
Expand Down
12 changes: 6 additions & 6 deletions actionpack/test/controller/new_base/render_action_test.rb
Expand Up @@ -45,7 +45,7 @@ def hello_world_with_custom_layout

end

class RenderActionTest < SimpleRouteCase
class RenderActionTest < Rack::TestCase
test "rendering an action using :action => <String>" do
get "/render_action/basic/hello_world"

Expand Down Expand Up @@ -82,7 +82,7 @@ class RenderActionTest < SimpleRouteCase
end
end

class RenderLayoutTest < SimpleRouteCase
class RenderLayoutTest < Rack::TestCase
describe "Both <controller_path>.html.erb and application.html.erb are missing"

test "rendering with layout => true" do
Expand Down Expand Up @@ -150,7 +150,7 @@ def with_builder_and_layout
end
end

class LayoutTest < SimpleRouteCase
class LayoutTest < Rack::TestCase
describe "Only application.html.erb is present and <controller_path>.html.erb is missing"

test "rendering implicit application.html.erb as layout" do
Expand Down Expand Up @@ -189,7 +189,7 @@ class LayoutTest < SimpleRouteCase
end
end

class TestLayout < SimpleRouteCase
class TestLayout < Rack::TestCase
testing BasicController

test "builder works with layouts" do
Expand Down Expand Up @@ -228,7 +228,7 @@ def hello_world_with_custom_layout
end
end

class ControllerLayoutTest < SimpleRouteCase
class ControllerLayoutTest < Rack::TestCase
describe "Only <controller_path>.html.erb is present and application.html.erb is missing"

test "render hello_world and implicitly use <controller_path>.html.erb as a layout." do
Expand Down Expand Up @@ -286,7 +286,7 @@ def hello_world_with_layout_nil
end
end

class ControllerLayoutTest < SimpleRouteCase
class ControllerLayoutTest < Rack::TestCase
describe "Both <controller_path>.html.erb and application.html.erb are present"

test "rendering implicitly use <controller_path>.html.erb over application.html.erb as a layout" do
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/render_file_test.rb
Expand Up @@ -48,7 +48,7 @@ def without_file_key_with_locals
end
end

class TestBasic < SimpleRouteCase
class TestBasic < Rack::TestCase
testing RenderFile::BasicController

test "rendering simple template" do
Expand Down
Expand Up @@ -10,7 +10,7 @@ class SimpleController < ::ApplicationController
def hello_world() end
end

class RenderImplicitActionTest < SimpleRouteCase
class RenderImplicitActionTest < Rack::TestCase
test "render a simple action with new explicit call to render" do
get "/render_implicit_action/simple/hello_world"

Expand Down
6 changes: 3 additions & 3 deletions actionpack/test/controller/new_base/render_layout_test.rb
Expand Up @@ -36,7 +36,7 @@ def index
end
end

class RenderLayoutTest < SimpleRouteCase
class RenderLayoutTest < Rack::TestCase
test "rendering a normal template, but using the implicit layout" do
get "/controller_layouts/implicit/index"

Expand All @@ -58,7 +58,7 @@ class RenderLayoutTest < SimpleRouteCase

end

class LayoutOptionsTest < SimpleRouteCase
class LayoutOptionsTest < Rack::TestCase
testing ControllerLayouts::ImplicitController

test "rendering with :layout => false leaves out the implicit layout" do
Expand All @@ -79,7 +79,7 @@ def explicit
end
end

class MismatchFormatTest < SimpleRouteCase
class MismatchFormatTest < Rack::TestCase
testing ControllerLayouts::MismatchFormatController

test "if JS is selected, an HTML template is not also selected" do
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/render_partial_test.rb
Expand Up @@ -15,7 +15,7 @@ def changing
end
end

class TestPartial < SimpleRouteCase
class TestPartial < Rack::TestCase
testing BasicController

test "rendering a partial in ActionView doesn't pull the ivars again from the controller" do
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/render_rjs_test.rb
Expand Up @@ -21,7 +21,7 @@ def index_locale
end
end

class TestBasic < SimpleRouteCase
class TestBasic < Rack::TestCase
testing BasicController

def setup
Expand Down
6 changes: 3 additions & 3 deletions actionpack/test/controller/new_base/render_template_test.rb
Expand Up @@ -39,7 +39,7 @@ def builder_template
end
end

class TestWithoutLayout < SimpleRouteCase
class TestWithoutLayout < Rack::TestCase
testing RenderTemplate::WithoutLayoutController

test "rendering a normal template with full path without layout" do
Expand Down Expand Up @@ -107,7 +107,7 @@ def with_custom_layout
end
end

class TestWithLayout < SimpleRouteCase
class TestWithLayout < Rack::TestCase
describe "Rendering with :template using implicit or explicit layout"

test "rendering with implicit layout" do
Expand Down Expand Up @@ -158,7 +158,7 @@ def with_forward_slash
end
end

class TestTemplateRenderWithForwardSlash < SimpleRouteCase
class TestTemplateRenderWithForwardSlash < Rack::TestCase
test "rendering a normal template with full path starting with a leading slash" do
get "/render_template/compatibility/without_layout/with_forward_slash"

Expand Down
6 changes: 3 additions & 3 deletions actionpack/test/controller/new_base/render_test.rb
Expand Up @@ -35,7 +35,7 @@ def index
end
end

class RenderTest < SimpleRouteCase
class RenderTest < Rack::TestCase
test "render with blank" do
get "/render/blank_render"

Expand All @@ -50,7 +50,7 @@ class RenderTest < SimpleRouteCase
end
end

class TestOnlyRenderPublicActions < SimpleRouteCase
class TestOnlyRenderPublicActions < Rack::TestCase
describe "Only public methods on actual controllers are callable actions"

test "raises an exception when a method of Object is called" do
Expand All @@ -66,7 +66,7 @@ class TestOnlyRenderPublicActions < SimpleRouteCase
end
end

class TestVariousObjectsAvailableInView < SimpleRouteCase
class TestVariousObjectsAvailableInView < Rack::TestCase
test "The request object is accessible in the view" do
get "/render/blank_render/access_request"
assert_body "The request: GET"
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/new_base/render_text_test.rb
Expand Up @@ -62,7 +62,7 @@ def with_ivar_in_layout
end
end

class RenderTextTest < SimpleRouteCase
class RenderTextTest < Rack::TestCase
describe "Rendering text using render :text"

test "rendering text from a action with default options renders the text with the layout" do
Expand Down
5 changes: 0 additions & 5 deletions actionpack/test/lib/controller/fake_controllers.rb
Expand Up @@ -44,8 +44,3 @@ class ChannelsController < SpeedController; end
class ChannelVideosController < SpeedController; end
class LostPasswordsController < SpeedController; end
class PagesController < SpeedController; end

ActionController::Routing::Routes.draw do |map|
map.route_one 'route_one', :controller => 'elsewhere', :action => 'flash_me'
map.connect ':controller/:action/:id'
end

0 comments on commit 61411f2

Please sign in to comment.