aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/column_definition_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-03-15 19:22:07 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-03-22 16:21:59 -0700
commit69ef76a6f8b1fbfdee81e753d6e50c3c0396d47c (patch)
tree52ee20e7ffe850e09efd0d0d17249ea7e533cba3 /activerecord/test/cases/column_definition_test.rb
parenta03ab8cef8c712cad3dafd06c1b483782a1c0eb5 (diff)
downloadrails-69ef76a6f8b1fbfdee81e753d6e50c3c0396d47c.tar.gz
rails-69ef76a6f8b1fbfdee81e753d6e50c3c0396d47c.tar.bz2
rails-69ef76a6f8b1fbfdee81e753d6e50c3c0396d47c.zip
remove knowledge of SQL from the column definition object
Diffstat (limited to 'activerecord/test/cases/column_definition_test.rb')
-rw-r--r--activerecord/test/cases/column_definition_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/column_definition_test.rb b/activerecord/test/cases/column_definition_test.rb
index bd2fbaa7db..000096c4b9 100644
--- a/activerecord/test/cases/column_definition_test.rb
+++ b/activerecord/test/cases/column_definition_test.rb
@@ -8,6 +8,7 @@ module ActiveRecord
def @adapter.native_database_types
{:string => "varchar"}
end
+ @viz = @adapter.schema_creation
end
def test_can_set_coder
@@ -37,7 +38,7 @@ module ActiveRecord
column_def = ColumnDefinition.new(
@adapter, column.name, "string",
column.limit, column.precision, column.scale, column.default, column.null)
- assert_equal "title varchar(20)", column_def.to_sql
+ assert_equal "title varchar(20)", @viz.accept(column_def)
end
def test_should_include_default_clause_when_default_is_present
@@ -45,7 +46,7 @@ module ActiveRecord
column_def = ColumnDefinition.new(
@adapter, column.name, "string",
column.limit, column.precision, column.scale, column.default, column.null)
- assert_equal %Q{title varchar(20) DEFAULT 'Hello'}, column_def.to_sql
+ assert_equal %Q{title varchar(20) DEFAULT 'Hello'}, @viz.accept(column_def)
end
def test_should_specify_not_null_if_null_option_is_false
@@ -53,7 +54,7 @@ module ActiveRecord
column_def = ColumnDefinition.new(
@adapter, column.name, "string",
column.limit, column.precision, column.scale, column.default, column.null)
- assert_equal %Q{title varchar(20) DEFAULT 'Hello' NOT NULL}, column_def.to_sql
+ assert_equal %Q{title varchar(20) DEFAULT 'Hello' NOT NULL}, @viz.accept(column_def)
end
if current_adapter?(:MysqlAdapter)