Skip to content
Browse files

Rename assert_attribute_type to asser_field_type.

  • Loading branch information...
1 parent 5ff6de0 commit 1a2d556de7935588e04c541e6c0804b5533db6b5 @josevalim josevalim committed May 16, 2010
Showing with 10 additions and 10 deletions.
  1. +3 −3 railties/lib/rails/generators/test_case.rb
  2. +7 −7 railties/test/generators/generated_attribute_test.rb
View
6 railties/lib/rails/generators/test_case.rb
@@ -192,11 +192,11 @@ def assert_instance_method(method, content)
# Asserts the given field name gets translated to an attribute type
# properly.
#
- # assert_attribute_type 'date', :date_select
+ # assert_field_type :date, :date_select
#
- def assert_attribute_type(name, attribute_type)
+ def assert_field_type(name, attribute_type)
assert_equal(
- Rails::Generators::GeneratedAttribute.new('test', name).field_type,
+ Rails::Generators::GeneratedAttribute.new('test', name.to_s).field_type,
attribute_type
)
end
View
14 railties/test/generators/generated_attribute_test.rb
@@ -6,35 +6,35 @@ class GeneratedAttributeTest < Rails::Generators::TestCase
def test_field_type_returns_text_field
%w(integer float decimal string).each do |name|
- assert_attribute_type name, :text_field
+ assert_field_type name, :text_field
end
end
def test_field_type_returns_datetime_select
%w(datetime timestamp).each do |name|
- assert_attribute_type name, :datetime_select
+ assert_field_type name, :datetime_select
end
end
def test_field_type_returns_time_select
- assert_attribute_type 'time', :time_select
+ assert_field_type 'time', :time_select
end
def test_field_type_returns_date_select
- assert_attribute_type 'date', :date_select
+ assert_field_type 'date', :date_select
end
def test_field_type_returns_text_area
- assert_attribute_type 'text', :text_area
+ assert_field_type 'text', :text_area
end
def test_field_type_returns_check_box
- assert_attribute_type 'boolean', :check_box
+ assert_field_type 'boolean', :check_box
end
def test_field_type_with_unknown_type_returns_text_field
%w(foo bar baz).each do |name|
- assert_attribute_type name, :text_field
+ assert_field_type name, :text_field
end
end
end

0 comments on commit 1a2d556

Please sign in to comment.
Something went wrong with that request. Please try again.