public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
ensure rspec's code example controllers are included in controller_paths
David Chelimsky (author)
Sat Aug 23 15:34:04 -0700 2008
commit  29b219dace226cb0e92df0edda3e73a3d6d6c261
tree    5c831a34b622ab3e29a0f2d54e6770dd0633bfae
parent  1825a662bf45a9630c3177c4109e3f17906723aa
...
12
13
14
15
 
 
 
 
 
 
16
17
18
...
38
39
40
 
 
 
 
 
 
41
42
43
...
12
13
14
 
15
16
17
18
19
20
21
22
23
...
43
44
45
46
47
48
49
50
51
52
53
54
0
@@ -12,7 +12,12 @@ require File.expand_path("#{dir}/../spec_resources/helpers/more_explicit_helper"
0
 require File.expand_path("#{dir}/../spec_resources/helpers/view_spec_helper")
0
 require File.expand_path("#{dir}/../spec_resources/helpers/plugin_application_helper")
0
 
0
-ActionController::Routing.controller_paths << File.expand_path("#{dir}/../spec_resources/controllers")
0
+extra_controller_paths = File.expand_path("#{dir}/../spec_resources/controllers")
0
+
0
+unless ActionController::Routing.controller_paths.include?(extra_controller_paths)
0
+  ActionController::Routing.instance_eval {@possible_controllers = nil}
0
+  ActionController::Routing.controller_paths << extra_controller_paths
0
+end
0
 
0
 module Spec
0
   module Rails
0
@@ -38,6 +43,12 @@ class Proc
0
   end
0
 end
0
 
0
+Spec::Runner.configure do |config|
0
+  config.before(:each, :type => :controller) do
0
+  end
0
+end
0
+
0
+
0
 ActionController::Routing::Routes.draw do |map|
0
   map.resources :rspec_on_rails_specs
0
   map.connect 'custom_route', :controller => 'custom_route_spec', :action => 'custom_route'

Comments