Skip to content

Commit 5122fbc

Browse files
committed
Added test case
1 parent bea0578 commit 5122fbc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/cases/temp_test_sqlserver.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# frozen_string_literal: true
2+
3+
require "cases/helper_sqlserver"
4+
require "models/topic"
5+
require "models/task"
6+
require "models/post"
7+
require "models/subscriber"
8+
require "models/minimalistic"
9+
require "models/college"
10+
11+
class TempTestSQLServer < ActiveRecord::TestCase
12+
# it "assert true" do
13+
# assert true
14+
# end
15+
16+
it "insert from one schema to another using raw SQL" do
17+
arunit_connection = Topic.lease_connection
18+
arunit2_connection = College.lease_connection
19+
20+
arunit_database = arunit_connection.pool.db_config.database
21+
arunit2_database = arunit2_connection.pool.db_config.database
22+
23+
sql = <<~SQL
24+
INSERT INTO #{arunit2_database}.dbo.dogs SELECT * FROM #{arunit_database}.dbo.dogs(id)
25+
SQL
26+
27+
assert_nothing_raised do
28+
arunit_connection.execute(sql)
29+
end
30+
end
31+
end

0 commit comments

Comments
 (0)