mirror of
https://github.com/github/rails.git
synced 2026-02-02 10:15:03 -05:00
Ruby 1.9 compat: test multibyte chars proxy for 1.8 only
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8553 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1229,19 +1229,21 @@ class BasicsTest < Test::Unit::TestCase
|
||||
topic = Topic.create('author_name' => author_name)
|
||||
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"
|
||||
|
||||
if RUBY_VERSION < '1.9'
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
def test_class_level_destroy
|
||||
should_be_destroyed_reply = Reply.create("title" => "hello", "content" => "world")
|
||||
Topic.find(1).replies << should_be_destroyed_reply
|
||||
|
||||
Reference in New Issue
Block a user