Make more Firebird tests pass (closes #5188) [kennethkunz@gmail.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2006-06-03 21:47:29 +00:00
parent 7f00f51239
commit 6a9f47f33f
6 changed files with 12 additions and 6 deletions

View File

@@ -14,7 +14,11 @@ class AAACreateTablesTest < Test::Unit::TestCase
end
def test_load_schema
eval(File.read("#{File.dirname(__FILE__)}/fixtures/db_definitions/schema.rb"))
if ActiveRecord::Base.connection.supports_migrations?
eval(File.read("#{File.dirname(__FILE__)}/fixtures/db_definitions/schema.rb"))
else
recreate ActiveRecord::Base, '3'
end
assert true
end

View File

@@ -58,7 +58,7 @@ ActiveRecord::Base.connection.class.class_eval do
cattr_accessor :query_count
# Array of regexes of queries that are not counted against query_count
@@ignore_list = [/^SELECT currval/]
@@ignore_list = [/^SELECT currval/, /^SELECT CAST/]
alias_method :execute_without_query_counting, :execute
def execute_with_query_counting(sql, name = nil)

View File

@@ -301,7 +301,8 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
end
def test_has_many_through_has_many_find_conditions
assert_equal comments(:does_it_hurt), authors(:david).comments.find(:first, :conditions => "comments.type='SpecialComment'", :order => 'comments.id')
options = { :conditions => "comments.#{QUOTED_TYPE}='SpecialComment'", :order => 'comments.id' }
assert_equal comments(:does_it_hurt), authors(:david).comments.find(:first, options)
end
def test_has_many_through_has_many_find_by_id

View File

@@ -133,7 +133,7 @@ class CalculationsTest < Test::Unit::TestCase
end
def test_should_calculate_grouped_by_function
c = Company.count(:all, :group => 'UPPER(type)')
c = Company.count(:all, :group => "UPPER(#{QUOTED_TYPE})")
assert_equal 2, c[nil]
assert_equal 1, c['DEPENDENTFIRM']
assert_equal 3, c['CLIENT']
@@ -141,7 +141,7 @@ class CalculationsTest < Test::Unit::TestCase
end
def test_should_calculate_grouped_by_function_with_table_alias
c = Company.count(:all, :group => 'UPPER(companies.type)')
c = Company.count(:all, :group => "UPPER(companies.#{QUOTED_TYPE})")
assert_equal 2, c[nil]
assert_equal 1, c['DEPENDENTFIRM']
assert_equal 3, c['CLIENT']

View File

@@ -56,3 +56,4 @@ DROP GENERATOR tasks_seq;
DROP GENERATOR categories_seq;
DROP GENERATOR keyboards_seq;
DROP GENERATOR defaults_seq;
DROP GENERATOR legacy_things_seq;

View File

@@ -1,4 +1,4 @@
CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1));
CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1) OR VALUE IS NULL);
CREATE TABLE accounts (
id BIGINT NOT NULL,