Skip to content

Commit 1dee0e1

Browse files
committed
Squashes warning raised by controller specs
[Fixes #785]
1 parent 9fc1191 commit 1dee0e1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
### Development
22
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...master)
33

4+
Bug fixes
5+
6+
* Fixes "warning: instance variable @orig\_routes not initialized" raised by
7+
controller specs when `--warnings` are enabled. (Andy Lindeman)
8+
49
### 2.14.0 / 2013-07-06
510
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
611

lib/rspec/rails/example/controller_example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def bypass_rescue
135135
def method_missing(method, *args, &block)
136136
if @routes && @routes.named_routes.helpers.include?(method)
137137
controller.send(method, *args, &block)
138-
elsif @orig_routes && @orig_routes.named_routes.helpers.include?(method)
138+
elsif defined?(@orig_routes) && @orig_routes && @orig_routes.named_routes.helpers.include?(method)
139139
controller.send(method, *args, &block)
140140
else
141141
super

0 commit comments

Comments
 (0)