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}
This commit is contained in:
parent
41501003fe
commit
ee787d9f58
@ -141,4 +141,12 @@ def test_handles_column_names_for_references
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user