File tree 2 files changed +25
-0
lines changed
features/controller_specs
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Enhancements
7
7
* Rails 4 support for ` ActiveRecord::Relation ` and the ` =~ ` operator matcher.
8
8
(Andy Lindeman)
9
9
* ` be_valid ` matcher includes validation error messages. (Tom Scott)
10
+ * Adds cucumber scenario showing how to invoke an anonymous controller's
11
+ non-resourceful actions. (Paulo Luis Franchini Casaretto)
10
12
11
13
Bug fixes
12
14
Original file line number Diff line number Diff line change @@ -328,3 +328,26 @@ Feature: anonymous controller
328
328
"""
329
329
When I run `rspec spec`
330
330
Then the examples should all pass
331
+
332
+ Scenario : draw custom routes for anonymous controllers
333
+ Given a file named "spec/controllers/application_controller_spec.rb" with:
334
+ """ruby
335
+ require "spec_helper"
336
+
337
+ describe ApplicationController do
338
+ controller do
339
+ def custom
340
+ render :text => "custom called"
341
+ end
342
+ end
343
+
344
+ specify "a custom action can be requested if routes are drawn manually" do
345
+ routes.draw { get "custom" => "anonymous#custom" }
346
+
347
+ get :custom
348
+ expect(response.body).to eq "custom called"
349
+ end
350
+ end
351
+ """
352
+ When I run `rspec spec`
353
+ Then the examples should all pass
You can’t perform that action at this time.
0 commit comments