diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-10-16 15:47:30 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-10-16 15:50:13 +0200 |
commit | ee787d9f581f52c72a701be9fef054903ee5b8c6 (patch) | |
tree | 6bd96484146b65c56e13f4001af944e1f1d0c260 /railties/test | |
parent | 41501003feec1e94e5494c45a08714e5326a3213 (diff) | |
download | rails-ee787d9f581f52c72a701be9fef054903ee5b8c6.tar.gz rails-ee787d9f581f52c72a701be9fef054903ee5b8c6.tar.bz2 rails-ee787d9f581f52c72a701be9fef054903ee5b8c6.zip |
test, `Generators::GeneratedAttribute` with references, required, index.
Closes #17197.
Closes #17207.
`{required}` is a type modifier so it should be:
user:references{required}:index
and not:
user:references:index{required}
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/generated_attribute_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/generators/generated_attribute_test.rb b/railties/test/generators/generated_attribute_test.rb index c48bc20899..ee7c009305 100644 --- a/railties/test/generators/generated_attribute_test.rb +++ b/railties/test/generators/generated_attribute_test.rb @@ -141,4 +141,12 @@ class GeneratedAttributeTest < Rails::Generators::TestCase assert_equal "post_id", create_generated_attribute('references', 'post').column_name assert_equal "post_id", create_generated_attribute('belongs_to', 'post').column_name end + + def test_parse_required_attribute_with_index + att = Rails::Generators::GeneratedAttribute.parse("supplier:references{required}:index") + assert_equal "supplier", att.name + assert_equal :references, att.type + assert att.has_index? + assert att.required? + end end |