Skip to content

Commit

Permalink
Update adapter_test_sqlserver.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Jun 8, 2024
1 parent 331ca6b commit 5091ca7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/cases/adapter_test_sqlserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
end

it "ALLOW deletion of referenced parent using #disable_referential_integrity block" do
SSTestHasPk.lease_connection.disable_referential_integrity { @parent.destroy }
assert_difference("SSTestHasPk.count", -1) do
SSTestHasPk.lease_connection.disable_referential_integrity { @parent.destroy }
end
end

it "again NOT ALLOW deletion of referenced parent after #disable_referential_integrity block" do
Expand Down Expand Up @@ -549,11 +551,15 @@ def test_doesnt_error_when_a_select_query_is_called_while_preventing_writes

describe 'table is in non-dbo schema' do
it "records can be created successfully" do
Alien.create!(name: 'Trisolarans')
assert_difference("Alien.count", 1) do
Alien.create!(name: 'Trisolarans')
end
end

it 'records can be inserted using SQL' do
Alien.lease_connection.exec_insert("insert into [test].[aliens] (id, name) VALUES(1, 'Trisolarans'), (2, 'Xenomorph')")
assert_difference("Alien.count", 2) do
Alien.lease_connection.exec_insert("insert into [test].[aliens] (id, name) VALUES(1, 'Trisolarans'), (2, 'Xenomorph')")
end
end
end

Expand Down

0 comments on commit 5091ca7

Please sign in to comment.