14
14
class AdapterTestSQLServer < ActiveRecord ::TestCase
15
15
fixtures :tasks
16
16
17
- let ( :arunit_connection ) { Topic . lease_connection }
17
+ let ( :arunit_connection ) { Topic . lease_connection }
18
18
let ( :arunit2_connection ) { College . lease_connection }
19
- let ( :arunit_database ) { arunit_connection . pool . db_config . database }
20
- let ( :arunit2_database ) { arunit2_connection . pool . db_config . database }
19
+ let ( :arunit_database ) { arunit_connection . pool . db_config . database }
20
+ let ( :arunit2_database ) { arunit2_connection . pool . db_config . database }
21
21
22
22
let ( :basic_insert_sql ) { "INSERT INTO [funny_jokes] ([name]) VALUES('Knock knock')" }
23
23
let ( :basic_merge_sql ) { "MERGE INTO [ships] WITH (UPDLOCK, HOLDLOCK) AS target USING ( SELECT * FROM ( SELECT [id], [name], ROW_NUMBER() OVER ( PARTITION BY [id] ORDER BY [id] DESC ) AS rn_0 FROM ( VALUES (101, N'RSS Sir David Attenborough') ) AS t1 ([id], [name]) ) AS ranked_source WHERE rn_0 = 1 ) AS source ON (target.[id] = source.[id]) WHEN MATCHED THEN UPDATE SET target.[name] = source.[name]" }
@@ -116,13 +116,13 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
116
116
db_config = ActiveRecord ::Base . configurations . configs_for ( env_name : "arunit" , name : "primary" )
117
117
configuration = db_config . configuration_hash . merge ( database : "nonexistent_activerecord_unittest" )
118
118
assert_not ActiveRecord ::ConnectionAdapters ::SQLServerAdapter . database_exists? ( configuration ) ,
119
- "expected database #{ configuration [ :database ] } to not exist"
119
+ "expected database #{ configuration [ :database ] } to not exist"
120
120
end
121
121
122
122
it "test database exists returns true when the database exists" do
123
123
db_config = ActiveRecord ::Base . configurations . configs_for ( env_name : "arunit" , name : "primary" )
124
124
assert ActiveRecord ::ConnectionAdapters ::SQLServerAdapter . database_exists? ( db_config . configuration_hash ) ,
125
- "expected database #{ db_config . database } to exist"
125
+ "expected database #{ db_config . database } to exist"
126
126
end
127
127
128
128
it "test primary key violation" do
@@ -476,8 +476,8 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
476
476
assert_equal columns . size , SSTestCustomersView . columns . size
477
477
columns . each do |colname |
478
478
assert_instance_of ActiveRecord ::ConnectionAdapters ::SQLServer ::Column ,
479
- SSTestCustomersView . columns_hash [ colname ] ,
480
- "Column name #{ colname . inspect } was not found in these columns #{ SSTestCustomersView . columns . map ( &:name ) . inspect } "
479
+ SSTestCustomersView . columns_hash [ colname ] ,
480
+ "Column name #{ colname . inspect } was not found in these columns #{ SSTestCustomersView . columns . map ( &:name ) . inspect } "
481
481
end
482
482
end
483
483
@@ -503,8 +503,8 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
503
503
assert_equal columns . size , SSTestStringDefaultsView . columns . size
504
504
columns . each do |colname |
505
505
assert_instance_of ActiveRecord ::ConnectionAdapters ::SQLServer ::Column ,
506
- SSTestStringDefaultsView . columns_hash [ colname ] ,
507
- "Column name #{ colname . inspect } was not found in these columns #{ SSTestStringDefaultsView . columns . map ( &:name ) . inspect } "
506
+ SSTestStringDefaultsView . columns_hash [ colname ] ,
507
+ "Column name #{ colname . inspect } was not found in these columns #{ SSTestStringDefaultsView . columns . map ( &:name ) . inspect } "
508
508
end
509
509
end
510
510
@@ -516,7 +516,7 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
516
516
517
517
it "find default values" do
518
518
assert_equal "null" , SSTestStringDefaultsView . new . pretend_null ,
519
- SSTestStringDefaultsView . columns_hash [ "pretend_null" ] . inspect
519
+ SSTestStringDefaultsView . columns_hash [ "pretend_null" ] . inspect
520
520
end
521
521
522
522
it "respond true to data_source_exists?" do
@@ -531,7 +531,7 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
531
531
532
532
it "using alternate view definition still be able to find real default" do
533
533
assert_equal "null" , SSTestStringDefaultsBigView . new . pretend_null ,
534
- SSTestStringDefaultsBigView . columns_hash [ "pretend_null" ] . inspect
534
+ SSTestStringDefaultsBigView . columns_hash [ "pretend_null" ] . inspect
535
535
end
536
536
end
537
537
0 commit comments