Skip to content

Commit 629a007

Browse files
committed
[Rails3] More tests passing.
1 parent acd697b commit 629a007

File tree

6 files changed

+9
-24
lines changed

6 files changed

+9
-24
lines changed

RAILS3_NOTES

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ on a local branch of our remote tracking branch.
3434

3535
= SQL Server Todo
3636

37-
2364 tests, 8447 assertions, 8 failures, 47 errors
37+
2364 tests, 9484 assertions, 7 failures, 44 errors
3838

3939
* SQL Server Test Cases
40-
x eager_association_test_sqlserver.rb (2) Limit offset stuff.
4140
x inheritance_test_sqlserver.rb (1) Recheck orig.
4241
x method_scoping_test_sqlserver.rb (1) Recheck orig.
43-
√ offset_and_limit_test_sqlserver.rb Would prefer a few more cases.
4442

4543
* Verify coerced tests
4644
Undefined coerced test: EagerAssociationTest#test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions

test/cases/eager_association_test_sqlserver.rb

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class EagerAssociationTestSqlserver < ActiveRecord::TestCase
99
class EagerAssociationTest < ActiveRecord::TestCase
1010

1111
COERCED_TESTS = [
12-
:test_count_with_include,
13-
:test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions,
14-
:test_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
12+
:test_count_with_include
1513
]
1614

1715
include SqlserverCoercedTest
@@ -22,21 +20,5 @@ def test_coerced_test_count_with_include
2220
assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "len(comments.body) > 15")
2321
end
2422

25-
def test_coerced_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions
26-
assert_queries(2) do
27-
posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10,
28-
:conditions => [ "authors.name = ? and comments.body = ?", 'David', 'go crazy' ])
29-
assert_equal 0, posts.size
30-
end
31-
end
32-
33-
def test_coerced_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
34-
assert_queries(2) do
35-
posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10,
36-
:conditions => { 'authors.name' => 'David', 'comments.body' => 'go crazy' })
37-
assert_equal 0, posts.size
38-
end
39-
end unless active_record_2_point_2?
40-
4123

4224
end

test/cases/method_scoping_test_sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_coerced_test_merged_scoped_find
1717
poor_jamis = developers(:poor_jamis)
1818
Developer.send(:with_scope, :find => { :conditions => "salary < 100000" }) do
1919
Developer.send(:with_scope, :find => { :offset => 1, :order => 'id asc' }) do
20-
assert_sql /ORDER BY id ASC/ do
20+
assert_sql /ORDER BY id asc/ do
2121
assert_equal(poor_jamis, Developer.find(:first, :order => 'id asc'))
2222
end
2323
end

test/cases/offset_and_limit_test_sqlserver.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class Account < ActiveRecord::Base; end
4141

4242
should 'alter SQL to limit number of records returned offset by specified amount' do
4343
sql = %|SELECT TOP (3) [_rnt].*
44-
FROM (SELECT ROW_NUMBER() OVER (ORDER BY [books].[id]) AS [rn], [books].* FROM [books]) AS [_rnt]
44+
FROM (
45+
SELECT ROW_NUMBER() OVER (ORDER BY [books].[id]) AS [rn], [books].*
46+
FROM [books]
47+
) AS [_rnt]
4548
WHERE [_rnt].[rn] > 5|.squish
4649
assert_sql(sql) { Book.limit(3).offset(5).all }
4750
end

test/connections/native_sqlserver/connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'logger'
44

55
ActiveRecord::Base.logger = Logger.new(File.expand_path(File.join(SQLSERVER_TEST_ROOT,'debug.log')))
6+
ActiveRecord::Base.logger.level = 0
67

78
ActiveRecord::Base.configurations = {
89
'arunit' => {

test/connections/native_sqlserver_odbc/connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'logger'
44

55
ActiveRecord::Base.logger = Logger.new(File.expand_path(File.join(SQLSERVER_TEST_ROOT,'debug.log')))
6+
ActiveRecord::Base.logger.level = 0
67

78
ActiveRecord::Base.configurations = {
89
'arunit' => {

0 commit comments

Comments
 (0)