Permalink
Browse files

Add two integration tests for GeneratedAttribute missing type error. [#…

…5461 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent d2fc5e2 commit 13d2a081645db873379668b6f21e449201b6b036 @rohit rohit committed with josevalim Sep 2, 2010
@@ -11,6 +11,12 @@ def test_help_shows_invoked_generators_options
assert_match /TestUnit options:/, content
end
+ def test_model_with_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
+ end
+
def test_invokes_default_orm
run_generator
assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
@@ -231,4 +231,10 @@ def test_scaffold_generator_on_revoke_does_not_mutilate_legacy_map_parameter
assert_file "config/routes.rb", /\.routes\.draw do\s*\|map\|\s*$/
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
+ end
end

0 comments on commit 13d2a08

Please sign in to comment.