From 731d813b53de09332dae169b703e9b24835cdb0f Mon Sep 17 00:00:00 2001 From: Sergey Dolganov Date: Thu, 9 Jan 2020 17:17:42 +0300 Subject: [PATCH] Add failing spec for #1652 --- .../example/controller_example_group_spec.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/spec/rspec/rails/example/controller_example_group_spec.rb b/spec/rspec/rails/example/controller_example_group_spec.rb index 6d982b51d3..7452f5823f 100644 --- a/spec/rspec/rails/example/controller_example_group_spec.rb +++ b/spec/rspec/rails/example/controller_example_group_spec.rb @@ -90,6 +90,35 @@ def my_helper example.foos_url end + + context "when controller is not a stub" do + let(:custom_contoller) do + stub_const( + "CustomController", + Class.new(ActionController::Base) do + def index + render plain: "ok" + end + end + ) + end + + let(:group) { group_for custom_contoller } + let(:controller) { custom_contoller } + + it "properly delegates routing assertions" do + with_isolated_stderr do + example.with_routing do |map| + map.draw do + get "custom" => "custom#index" + end + + expect { example.get :index }.not_to raise_error + end + end + end + end + end describe "#bypass_rescue" do