aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_case.rb
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-05-17 02:40:15 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-05-17 02:40:15 +0430
commitd148a6f6ba5f8ee65905f12cd2601fcc377d4852 (patch)
tree4bcb5e7ad47cfb9a9bb14ffe7c9e003d4646d64c /railties/lib/rails/generators/test_case.rb
parente1c773006969abea3c0619fbdc7e32c121b6085f (diff)
parent6b4e0cc526f55b5532cf99292c94f0a4db53b16f (diff)
downloadrails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.tar.gz
rails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.tar.bz2
rails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/lib/rails/generators/test_case.rb')
-rw-r--r--railties/lib/rails/generators/test_case.rb12
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..952400e049 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_field_type :date, :date_select
+ #
+ def assert_field_type(name, attribute_type)
+ assert_equal(
+ Rails::Generators::GeneratedAttribute.new('test', name.to_s).field_type,
+ attribute_type
+ )
+ end
+
# Runs the generator configured for this class. The first argument is an array like
# command line arguments:
#