File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ Bug fixes
1111
1212* Add ` should ` and ` should_not ` to ` CollectionProxy ` (Rails 3.1+) and
1313 ` AssociationProxy ` (Rails 3.0). (Myron Marston)
14+ * ` controller.controller_path ` is set correctly for view specs in Rails 3.1+.
15+ (Andy Lindeman)
1416
1517### 2.11.0 / 2012-07-07
1618[ full changelog] ( http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0 )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Feature: view spec infers controller path and action
88 describe "widgets/new" do
99 it "infers the controller path" do
1010 expect(controller.request.path_parameters[:controller]).to eq("widgets")
11+ expect(controller.controller_path).to eq("widgets")
1112 end
1213 end
1314 """
Original file line number Diff line number Diff line change @@ -142,10 +142,9 @@ def _include_controller_helpers
142142 if view . lookup_context . respond_to? ( :prefixes )
143143 # rails 3.1
144144 view . lookup_context . prefixes << _controller_path
145- else
146- # rails 3.0
147- controller . controller_path = _controller_path
148145 end
146+
147+ controller . controller_path = _controller_path
149148 controller . request . path_parameters [ :controller ] = _controller_path
150149 controller . request . path_parameters [ :action ] = _inferred_action unless _inferred_action =~ /^_/
151150 end
You can’t perform that action at this time.
0 commit comments