File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 201201 allow_any_instance_of ( ActionController ::TestRequest ) . to receive ( :referer ) . and_return ( 'http://test.host/referer_action' )
202202 end
203203
204- it 'uses Rails 7 redirect_back_or_to method' do
205- get :test_return_to
204+ context 'when Rails::VERSION::MAJOR >= 7' , skip : Rails ::VERSION ::MAJOR < 7 do
205+ it 'uses Rails 7 redirect_back_or_to method' do
206+ get :test_return_to
207+
208+ expect ( response ) . to redirect_to ( 'http://test.host/referer_action' )
209+ end
210+ end
206211
207- expect ( response ) . to redirect_to ( 'http://test.host/referer_action' )
212+ context 'when Rails::VERSION::MAJOR < 7' , skip : Rails ::VERSION ::MAJOR >= 7 do
213+ it 'raise NoMethodError' do
214+ expect { get :test_return_to } . to raise_error ( NoMethodError )
215+ end
208216 end
209217 end
210218
You can’t perform that action at this time.
0 commit comments