diff options
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/test_case.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 6b97c69d8d..24b57aabf9 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -189,6 +189,18 @@ module Rails end alias :assert_method :assert_instance_method + # Asserts the given field name gets translated to an attribute type + # properly. + # + # assert_attribute_type 'date', :date_select + # + def assert_attribute_type(name, attribute_type) + assert_equal( + Rails::Generators::GeneratedAttribute.new('test', name).field_type, + attribute_type + ) + end + # Runs the generator configured for this class. The first argument is an array like # command line arguments: # |