aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-05-12 00:44:50 +0000
committerMichael Koziarski <michael@koziarski.com>2007-05-12 00:44:50 +0000
commita722b480008c0609c08e20d4286dd1c1af00823c (patch)
treecb9c0d6caea78aaf1b10bd96eb8a434205f5e8f0 /activerecord/test
parente105e599e706780905d4c348394da989de3b200f (diff)
downloadrails-a722b480008c0609c08e20d4286dd1c1af00823c.tar.gz
rails-a722b480008c0609c08e20d4286dd1c1af00823c.tar.bz2
rails-a722b480008c0609c08e20d4286dd1c1af00823c.zip
Ensure copy table test runs for sqlite and sqlite3. [mislav] Cllosoes #8328
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6721 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/copy_table_test_sqlite.rb (renamed from activerecord/test/copy_table_sqlite.rb)7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/copy_table_sqlite.rb b/activerecord/test/copy_table_test_sqlite.rb
index f3f5f1ce46..6da041522f 100644
--- a/activerecord/test/copy_table_sqlite.rb
+++ b/activerecord/test/copy_table_test_sqlite.rb
@@ -26,8 +26,9 @@ class CopyTableTest < Test::Unit::TestCase
def test_copy_table_renaming_column
test_copy_table('companies', 'companies2',
:rename => {'client_of' => 'fan_of'}) do |from, to, options|
- assert_equal column_values(from, 'client_of').compact.sort,
- column_values(to, 'fan_of').compact.sort
+ expected = column_values(from, 'client_of')
+ assert expected.any?, 'only nils in resultset; real values are needed'
+ assert_equal expected, column_values(to, 'fan_of')
end
end
@@ -51,7 +52,7 @@ protected
end
def column_values(table, column)
- @connection.select_all("SELECT #{column} FROM #{table}").map {|row| row[column]}
+ @connection.select_all("SELECT #{column} FROM #{table} ORDER BY id").map {|row| row[column]}
end
def table_indexes_without_name(table)