aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/named_base_test.rb
diff options
context:
space:
mode:
authorTimothy N. Tsvetkov <timothy.tsvetkov@gmail.com>2011-02-08 04:26:42 +0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-16 15:09:06 -0200
commitc6fac7b449ad88a623d99487d2731dddc6555636 (patch)
tree9abd5868d39ca62bd999a70b1863dda7d837ca3b /railties/test/generators/named_base_test.rb
parent1754bd9b208e8d9207c226d1ffb3cee490856a78 (diff)
downloadrails-c6fac7b449ad88a623d99487d2731dddc6555636.tar.gz
rails-c6fac7b449ad88a623d99487d2731dddc6555636.tar.bz2
rails-c6fac7b449ad88a623d99487d2731dddc6555636.zip
Fixed issue #6363, avoid to pluralized already pluralized names and singularize a single in generators, for example stadia is a valid plural for stadium. But calling pluralize for stadia will return stadias which sematically is not corrent in this case
[#6363 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'railties/test/generators/named_base_test.rb')
-rw-r--r--railties/test/generators/named_base_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/test/generators/named_base_test.rb b/railties/test/generators/named_base_test.rb
index 1badae0713..f23701e99e 100644
--- a/railties/test/generators/named_base_test.rb
+++ b/railties/test/generators/named_base_test.rb
@@ -98,6 +98,11 @@ class NamedBaseTest < Rails::Generators::TestCase
assert_name g, 'posts', :index_helper
end
+ def test_index_helper_to_pluralize_once
+ g = generator ['Stadium']
+ assert_name g, 'stadia', :index_helper
+ end
+
def test_index_helper_with_uncountable
g = generator ['Sheep']
assert_name g, 'sheep_index', :index_helper