@@ -254,63 +254,6 @@ def log_initializer
254254 booter . to_app . should == app
255255 end
256256
257- it "should set config.action_controller.relative_url_root based on ENV['RAILS_RELATIVE_URL_ROOT']" do
258- ENV [ 'RAILS_RELATIVE_URL_ROOT' ] = '/blah'
259- app = double "app"
260- app . stub_chain ( :config , :action_controller , :relative_url_root )
261- app . config . action_controller . should_receive ( :relative_url_root= ) . with ( "/blah" )
262- before_config = Rails ::Railtie . __initializer . detect { |i | i . first =~ /url/ }
263- before_config . should_not be_nil
264- before_config [ 1 ] . should == [ { :after => "action_controller.set_configs" } ]
265- before_config . last . call ( app )
266- end
267-
268- end # if defined? Rails
269-
270- # NOTE: specs currently only test with a stubbed Rails::Railtie
271- describe "Rails 3.1" , :lib => [ :stub ] do
272-
273- before :each do
274- $servlet_context = @servlet_context
275- #booter.layout_class = JRuby::Rack::FileSystemLayout
276- booter . app_path = RAILS_ROOT_DIR . dup
277- def booter . rails2? ; false end
278- booter . boot!
279- booter . load_environment
280- end
281-
282- after :all do
283- $servlet_context = nil
284- end
285-
286- #
287- # relative_url_root= has been deprecated in Rails > 3. We should not call it when it's not defined.
288- # See: https://github.com/jruby/jruby-rack/issues/73
289- # https://github.com/rails/rails/issues/2435
290- #
291- it "should not set config.action_controller.relative_url_root if the controller doesn't respond to that method" do
292- require 'action_controller' # stub
293- begin
294- #ActionController::Base.send :remove_method, :relative_url_root=
295- ENV [ 'RAILS_RELATIVE_URL_ROOT' ] = '/blah'
296- app = double "app"
297- app . stub_chain ( :config , :action_controller )
298- app . config . stub ( :action_controller ) . and_return ( nil )
299- # app.config.action_controller.should_not_receive(:relative_url_root=)
300- ActionController ::Base . stub ( :config ) . and_return app . config
301-
302- app . config . should_receive ( :relative_url_root= ) . with ( '/blah' )
303- ActionController ::Base . should_not_receive ( :relative_url_root= )
304-
305- init = Rails ::Railtie . __initializer . detect { |i | i . first =~ /url/ }
306- init . should_not be nil
307- init [ 1 ] . should == [ { :after => "action_controller.set_configs" } ]
308- init . last . call ( app )
309- ensure
310- #ActionController::Base.send :attr_writer, :relative_url_root
311- end
312- end
313-
314257 end # if defined? Rails
315258
316259end
0 commit comments