1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove more tests related to draw external routes files

Related with 5e7d6bba79
This commit is contained in:
Rafael Mendonça França 2012-06-29 14:33:09 -03:00
parent 1abe31670f
commit 7406d69ecc
4 changed files with 1 additions and 53 deletions

View file

@ -4,12 +4,11 @@ module ActionDispatch
module Routing module Routing
class MapperTest < ActiveSupport::TestCase class MapperTest < ActiveSupport::TestCase
class FakeSet class FakeSet
attr_reader :routes, :draw_paths attr_reader :routes
alias :set :routes alias :set :routes
def initialize def initialize
@routes = [] @routes = []
@draw_paths = []
end end
def resources_path_names def resources_path_names

View file

@ -2324,55 +2324,6 @@ class TestNamespaceWithControllerOption < ActionDispatch::IntegrationTest
end end
end end
class TestDrawExternalFile < ActionDispatch::IntegrationTest
class ExternalController < ActionController::Base
def index
render :text => "external#index"
end
end
DRAW_PATH = File.expand_path('../../fixtures/routes', __FILE__)
DefaultScopeRoutes = ActionDispatch::Routing::RouteSet.new.tap do |app|
app.draw_paths << DRAW_PATH
end
def app
DefaultScopeRoutes
end
def test_draw_external_file
DefaultScopeRoutes.draw do
scope :module => 'test_draw_external_file' do
draw :external
end
end
get '/external'
assert_equal "external#index", @response.body
end
def test_draw_nonexistent_file
exception = assert_raise ArgumentError do
DefaultScopeRoutes.draw do
draw :nonexistent
end
end
assert_match 'Your router tried to #draw the external file nonexistent.rb', exception.message
assert_match DRAW_PATH.to_s, exception.message
end
def test_draw_bogus_file
exception = assert_raise NoMethodError do
DefaultScopeRoutes.draw do
draw :bogus
end
end
assert_match "undefined method `wrong'", exception.message
assert_match 'test/fixtures/routes/bogus.rb:1', exception.backtrace.first
end
end
class TestDefaultScope < ActionDispatch::IntegrationTest class TestDefaultScope < ActionDispatch::IntegrationTest
module ::Blog module ::Blog
class PostsController < ActionController::Base class PostsController < ActionController::Base

View file

@ -1 +0,0 @@
wrong :route

View file

@ -1 +0,0 @@
get '/external' => 'external#index'