Skip to content

Commit ac01b7c

Browse files
committed
Add failing spec for #1652
1 parent 86a5c1f commit ac01b7c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

spec/rspec/rails/example/controller_example_group_spec.rb

+29
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,35 @@ def my_helper
9090

9191
example.foos_url
9292
end
93+
94+
context "when controller is not a stub" do
95+
let(:custom_contoller) do
96+
stub_const(
97+
'CustomController',
98+
Class.new(ActionController::Base) do
99+
def index
100+
render plain: "ok"
101+
end
102+
end
103+
)
104+
end
105+
106+
let(:group) { group_for custom_contoller }
107+
let(:controller) { custom_contoller }
108+
109+
it "properly delegates routing assertions" do
110+
with_isolated_stderr do
111+
example.with_routing do |map|
112+
map.draw do
113+
get 'custom' => "custom#index"
114+
end
115+
116+
expect { example.get :index }.not_to raise_error
117+
end
118+
end
119+
end
120+
end
121+
93122
end
94123

95124
describe "#bypass_rescue" do

0 commit comments

Comments
 (0)