aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-04-22 15:17:56 +0000
committerRick Olson <technoweenie@gmail.com>2006-04-22 15:17:56 +0000
commit92bd54ea1902cd8477295f0ca50598ad3a0f9d97 (patch)
tree6bc7bac4a54d6c81302be2da2f989c0bd9fcb819 /actionpack/lib/action_controller
parent84ec53753afd8b7288d5ac224c3157c3943df054 (diff)
downloadrails-92bd54ea1902cd8477295f0ca50598ad3a0f9d97.tar.gz
rails-92bd54ea1902cd8477295f0ca50598ad3a0f9d97.tar.bz2
rails-92bd54ea1902cd8477295f0ca50598ad3a0f9d97.zip
Use ActiveSupport's String#join method
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4250 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/assertions.rb8
1 files 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)