diff options
Diffstat (limited to 'railties/test/generators/rails_model_generator_test.rb')
-rw-r--r-- | railties/test/generators/rails_model_generator_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/generators/rails_model_generator_test.rb b/railties/test/generators/rails_model_generator_test.rb index 67cd3aa26f..aea2abafba 100644 --- a/railties/test/generators/rails_model_generator_test.rb +++ b/railties/test/generators/rails_model_generator_test.rb @@ -37,4 +37,12 @@ class RailsModelGeneratorTest < GeneratorTestCase assert body =~ /^\s+belongs_to :supplier/, "#{body.inspect} should contain 'belongs_to :supplier'" end end + + def test_model_with_belongs_to_attributes_generates_belongs_to_associations + run_generator('model', %w(Product name:string supplier:belongs_to)) + + assert_generated_model_for :product do |body| + assert body =~ /^\s+belongs_to :supplier/, "#{body.inspect} should contain 'belongs_to :supplier'" + end + end end |