module Rails::Generators::Testing::Assertions

def assert_field_default_value(attribute_type, value)

assert_field_default_value :string, "MyString"

Asserts the given attribute type gets a proper default value:
def assert_field_default_value(attribute_type, value)
  if value.nil?
    assert_nil(create_generated_attribute(attribute_type).default)
  else
    assert_equal(value, create_generated_attribute(attribute_type).default)
  end
end