File tree Expand file tree Collapse file tree 3 files changed +28
-35
lines changed Expand file tree Collapse file tree 3 files changed +28
-35
lines changed Original file line number Diff line number Diff 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-
4134end
4235
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments