From 92bd54ea1902cd8477295f0ca50598ad3a0f9d97 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Sat, 22 Apr 2006 15:17:56 +0000 Subject: Use ActiveSupport's String#join method git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4250 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/assertions.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index e94afae35a..b2da11045b 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -92,10 +92,10 @@ module Test #:nodoc: value.stringify_keys! if value.is_a?(Hash) if value.respond_to?(:[]) && value['controller'] - if key == :actual && value['controller'][0..0] != '/' + if key == :actual && value['controller'].first != '/' value['controller'] = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path) end - value['controller'] = value['controller'][1..-1] if value['controller'][0..0] == '/' # strip leading hash + value['controller'] = value['controller'][1..-1] if value['controller'].first == '/' # strip leading hash end url[key] = value end @@ -116,7 +116,7 @@ module Test #:nodoc: url_regexp = %r{^(\w+://.*?(/|$|\?))(.*)$} eurl, epath, url, path = [options, @response.redirect_url].collect do |url| u, p = (url_regexp =~ url) ? [$1, $3] : [nil, url] - [u, (p[0..0] == '/') ? p : '/' + p] + [u, (p.first == '/') ? p : '/' + p] end.flatten assert_equal(eurl, url, msg) if eurl && url @@ -333,7 +333,7 @@ module Test #:nodoc: private def recognized_request_for(path) - path = "/#{path}" unless path[0..0] == '/' + path = "/#{path}" unless path.first == '/' # Assume given controller request = ActionController::TestRequest.new({}, {}, nil) -- cgit v1.2.3