From 912f14419076c26c1d281848b74048cfcfd1d85f Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Mon, 23 Jan 2012 16:17:56 +0530 Subject: test base64 encode and decode --- activesupport/test/core_ext/base64_ext_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/activesupport/test/core_ext/base64_ext_test.rb b/activesupport/test/core_ext/base64_ext_test.rb index 544c990b3c..07052a366a 100644 --- a/activesupport/test/core_ext/base64_ext_test.rb +++ b/activesupport/test/core_ext/base64_ext_test.rb @@ -7,4 +7,13 @@ class Base64Test < Test::Unit::TestCase assert_no_match(/\n/, ActiveSupport::Base64.encode64s("oneverylongstringthatwouldnormallybesplitupbynewlinesbytheregularbase64")) end end + + def test_encode_and_decode + ActiveSupport::Deprecation.silence do + string = "foobar" + encoded_string = ActiveSupport::Base64.encode64(string) + assert_equal "Zm9vYmFy\n", encoded_string + assert_equal string, ActiveSupport::Base64.decode64(encoded_string) + end + end end -- cgit v1.2.3