Permalink
Browse files

test base64 encode and decode

  • Loading branch information...
1 parent 70d81b3 commit 912f14419076c26c1d281848b74048cfcfd1d85f @vijaydev vijaydev committed Jan 23, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 activesupport/test/core_ext/base64_ext_test.rb
@@ -7,4 +7,13 @@ def test_no_newline_in_encoded_value
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

0 comments on commit 912f144

Please sign in to comment.