File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
features/controller_specs Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,31 @@ Feature: anonymous controller
470
470
When I run `rspec spec`
471
471
Then the examples should all pass
472
472
473
+ Scenario : Draw custom routes for anonymous controllers which don't inherit from application controller
474
+ Given a file named "spec/controllers/other_controller_spec.rb" with:
475
+ """ruby
476
+ require "rails_helper"
477
+ class OtherController < ActionController::Base
478
+ end
479
+
480
+ RSpec.describe OtherController, :type => :controller do
481
+ controller do
482
+ def custom
483
+ render :text => "custom called"
484
+ end
485
+ end
486
+
487
+ specify "manually draw the route to request a custom action" do
488
+ routes.draw { get "custom" => "other#custom" }
489
+
490
+ get :custom
491
+ expect(response.body).to eq "custom called"
492
+ end
493
+ end
494
+ """
495
+ When I run `rspec spec`
496
+ Then the examples should all pass
497
+
473
498
Scenario : Draw custom routes for defined controllers
474
499
Given a file named "spec/controllers/application_controller_spec.rb" with:
475
500
"""ruby
You can’t perform that action at this time.
0 commit comments