Skip to content
This repository
Browse code

Remove more tests related to draw external routes files

Related with 5e7d6bb
  • Loading branch information...
commit 7406d69ecc7209ab5fe9ed0b76cadd5a55988fac 1 parent 1abe316
Rafael Mendonça França authored June 29, 2012
3  actionpack/test/dispatch/mapper_test.rb
@@ -4,12 +4,11 @@ module ActionDispatch
4 4
   module Routing
5 5
     class MapperTest < ActiveSupport::TestCase
6 6
       class FakeSet
7  
-        attr_reader :routes, :draw_paths
  7
+        attr_reader :routes
8 8
         alias :set :routes
9 9
 
10 10
         def initialize
11 11
           @routes = []
12  
-          @draw_paths = []
13 12
         end
14 13
 
15 14
         def resources_path_names
49  actionpack/test/dispatch/routing_test.rb
@@ -2324,55 +2324,6 @@ def test_controller_options
2324 2324
   end
2325 2325
 end
2326 2326
 
2327  
-class TestDrawExternalFile < ActionDispatch::IntegrationTest
2328  
-  class ExternalController < ActionController::Base
2329  
-    def index
2330  
-      render :text => "external#index"
2331  
-    end
2332  
-  end
2333  
-
2334  
-  DRAW_PATH = File.expand_path('../../fixtures/routes', __FILE__)
2335  
-
2336  
-  DefaultScopeRoutes = ActionDispatch::Routing::RouteSet.new.tap do |app|
2337  
-    app.draw_paths << DRAW_PATH
2338  
-  end
2339  
-
2340  
-  def app
2341  
-    DefaultScopeRoutes
2342  
-  end
2343  
-
2344  
-  def test_draw_external_file
2345  
-    DefaultScopeRoutes.draw do
2346  
-      scope :module => 'test_draw_external_file' do
2347  
-        draw :external
2348  
-      end
2349  
-    end
2350  
-
2351  
-    get '/external'
2352  
-    assert_equal "external#index", @response.body
2353  
-  end
2354  
-
2355  
-  def test_draw_nonexistent_file
2356  
-    exception = assert_raise ArgumentError do
2357  
-      DefaultScopeRoutes.draw do
2358  
-        draw :nonexistent
2359  
-      end
2360  
-    end
2361  
-    assert_match 'Your router tried to #draw the external file nonexistent.rb', exception.message
2362  
-    assert_match DRAW_PATH.to_s, exception.message
2363  
-  end
2364  
-
2365  
-  def test_draw_bogus_file
2366  
-    exception = assert_raise NoMethodError do
2367  
-      DefaultScopeRoutes.draw do
2368  
-        draw :bogus
2369  
-      end
2370  
-    end
2371  
-    assert_match "undefined method `wrong'", exception.message
2372  
-    assert_match 'test/fixtures/routes/bogus.rb:1', exception.backtrace.first
2373  
-  end
2374  
-end
2375  
-
2376 2327
 class TestDefaultScope < ActionDispatch::IntegrationTest
2377 2328
   module ::Blog
2378 2329
     class PostsController < ActionController::Base
1  actionpack/test/fixtures/routes/bogus.rb
... ...
@@ -1 +0,0 @@
1  
-wrong :route
1  actionpack/test/fixtures/routes/external.rb
... ...
@@ -1 +0,0 @@
1  
-get '/external' => 'external#index'

0 notes on commit 7406d69

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