diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 12:02:04 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 12:02:04 +0000 |
commit | 9104d63f9917df5a363e073f62402a91a16ccf40 (patch) | |
tree | fe08941814aea2623cf721bcb7c9520ab6aad5b1 /activerecord/test | |
parent | cd6beacfb3f503fe28410a67f155bb4509e76819 (diff) | |
download | rails-9104d63f9917df5a363e073f62402a91a16ccf40.tar.gz rails-9104d63f9917df5a363e073f62402a91a16ccf40.tar.bz2 rails-9104d63f9917df5a363e073f62402a91a16ccf40.zip |
Quote ActiveSupport::Multibyte::Chars. Closes #6653.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index bb057e75f8..8cd17d7034 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1102,6 +1102,18 @@ class BasicsTest < Test::Unit::TestCase assert_equal author_name, Topic.find(topic.id).author_name end + def test_quote_chars + str = 'The Narrator' + topic = Topic.create(:author_name => str) + assert_equal str, topic.author_name + + assert_kind_of ActiveSupport::Multibyte::Chars, str.chars + topic = Topic.find_by_author_name(str.chars) + + assert_kind_of Topic, topic + assert_equal str, topic.author_name, "The right topic should have been found by name even with name passed as Chars" + end + def test_class_level_destroy should_be_destroyed_reply = Reply.create("title" => "hello", "content" => "world") Topic.find(1).replies << should_be_destroyed_reply |