From 08983fefd547142ef8b913af1859b96597753d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 17 Jun 2011 15:10:53 -0300 Subject: Attributes on scaffold and model generators default to string. This allows the following: "rails g scaffold Post title body:text author" --- railties/test/generators/scaffold_generator_test.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'railties/test/generators/scaffold_generator_test.rb') diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index 2135ffac81..c3c6015291 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -272,8 +272,14 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase end def test_scaffold_generator_outputs_error_message_on_missing_attribute_type - content = capture(:stderr) { run_generator ["post", "title:string", "body"]} - assert_match(/Missing type for attribute 'body'/, content) - assert_match(/Example: 'body:string' where string is the type/, content) + run_generator ["post", "title", "body:text", "author"] + + assert_migration "db/migrate/create_posts.rb" do |m| + assert_method :change, m do |up| + assert_match(/t\.string :title/, up) + assert_match(/t\.text :body/, up) + assert_match(/t\.string :author/, up) + end + end end end -- cgit v1.2.3