Skip to content

Commit 05d5dc9

Browse files
author
Anna
committed
more coerced tests added and deleted
1 parent c28bb50 commit 05d5dc9

File tree

3 files changed

+28
-35
lines changed

3 files changed

+28
-35
lines changed

test/cases/finder_test_sqlserver.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class FinderTest < ActiveRecord::TestCase
1010
COERCED_TESTS = [
1111
:test_exists_does_not_select_columns_without_alias,
1212
:test_string_sanitation,
13-
:test_first_and_last_with_integer_should_use_sql_limit,
1413
:test_take_and_first_and_last_with_integer_should_use_sql_limit
1514
]
1615

@@ -27,16 +26,10 @@ def test_coerced_string_sanitation
2726
assert_equal "N'something; select table'", ActiveRecord::Base.sanitize("something; select table")
2827
end
2928

30-
def test_coerced_first_and_last_with_integer_should_use_sql_limit
31-
assert_sql(/TOP \(2\)/) { Topic.first(2).entries }
32-
assert_sql(/TOP \(5\)/) { Topic.last(5).entries }
33-
end
34-
3529
def test_coerced_take_and_first_and_last_with_integer_should_use_sql_limit
3630
assert_sql(/TOP \(3\)/) { Topic.take(3).entries }
3731
assert_sql(/TOP \(2\)/) { Topic.first(2).entries }
3832
assert_sql(/TOP \(5\)/) { Topic.last(5).entries }
3933
end
40-
4134
end
4235

test/cases/method_scoping_test_sqlserver.rb

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require "cases/sqlserver_helper"
2+
require 'models/post'
3+
4+
5+
class RelationTest < ActiveRecord::TestCase
6+
COERCED_TESTS = [:test_merging_reorders_bind_params]
7+
# Until that patch is made to rails we are preventing this test from running in this gem.
8+
include SqlserverCoercedTest
9+
fixtures :posts
10+
11+
def test_coerced_merging_reorders_bind_params
12+
puts "RUNS"
13+
post = Post.first
14+
id_column = Post.columns_hash['id']
15+
title_column = Post.columns_hash['title']
16+
17+
bvr = Post.connection.substitute_at id_column, 1
18+
right = Post.where(id: bvr)
19+
right.bind_values += [[id_column, post.id]]
20+
21+
bvl = Post.connection.substitute_at title_column, 0
22+
left = Post.where(title: bvl)
23+
left.bind_values += [[title_column, post.title]]
24+
25+
merged = left.merge(right)
26+
assert_equal post, merged.first
27+
end
28+
end

0 commit comments

Comments
 (0)