aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authortumayun <tumayun.2010@gmail.com>2012-11-16 12:11:03 +0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 21:23:28 -0200
commite492c446d520e8941624564b157b297cfd0aeaa9 (patch)
treea9c95820e64d846919e91c6de33e55617aaa9e41 /actionpack/test
parentbba8fc4294ca7f7d90c3e64e7fea059b17caef5c (diff)
downloadrails-e492c446d520e8941624564b157b297cfd0aeaa9.tar.gz
rails-e492c446d520e8941624564b157b297cfd0aeaa9.tar.bz2
rails-e492c446d520e8941624564b157b297cfd0aeaa9.zip
Fix issue with params in url_for
With a "params" argument, the following error is raised: undefined method `reject!` for "":String
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 2bc145c1cc..08d1c6fe73 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -799,6 +799,14 @@ class RequestTest < ActiveSupport::TestCase
end
end
+ test "url_for options[:params]" do
+ assert_equal 'http://www.example.com?params=', url_for(:params => '')
+ assert_equal 'http://www.example.com?params=1', url_for(:params => 1)
+ assert_equal 'http://www.example.com', url_for
+ assert_equal 'http://www.example.com', url_for(:params => {})
+ assert_equal 'http://www.example.com?name=tumayun', url_for(:params => { :name => 'tumayun' })
+ end
+
protected
def stub_request(env = {})