Permalink
Browse files

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
  • Loading branch information...
1 parent 7f00f51 commit 6a9f47f33f853c6899bb50bf21e49da798bdd12e @dhh dhh committed Jun 3, 2006
@@ -14,7 +14,11 @@ def test_drop_and_create_main_tables
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
@@ -58,7 +58,7 @@ def current_adapter?(type)
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)
@@ -301,7 +301,8 @@ def test_has_many_through_has_many_find_first
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
@@ -133,15 +133,15 @@ def test_should_calculate_grouped_association_with_invalid_field
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']
assert_equal 2, c['FIRM']
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']
@@ -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;
@@ -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,

0 comments on commit 6a9f47f

Please sign in to comment.