From 60ffe41980f3989637bdf537341288288aa9cc39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 19 Jun 2012 00:36:30 -0300 Subject: Extract conditional to a method to avoid duplication Also use if/else block to not use short circuit return --- activerecord/test/cases/calculations_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index abb25fa63a..f748b897ee 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -423,6 +423,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_maximum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).maximum(:developer_id) else @@ -433,6 +434,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_minimum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).minimum(:developer_id) else @@ -443,6 +445,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_sum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:MysqlAdapter) || current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).sum(:developer_id) else -- cgit v1.2.3