Skip to content

Commit c571dc5

Browse files
committed
Remove dependency on upsert in test
1 parent 2ccb037 commit c571dc5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,3 +2474,18 @@ def invalid_add_column_option_exception_message(key)
24742474
end
24752475
end
24762476
end
2477+
2478+
# SQL Server does not support upsert. Removed dependency on `insert_all` that uses upsert.
2479+
class ActiveRecord::Encryption::ConcurrencyTest < ActiveRecord::EncryptionTestCase
2480+
def thread_encrypting_and_decrypting(thread_label)
2481+
posts = 100.times.collect { |index| EncryptedPost.create! title: "Article #{index} (#{thread_label})", body: "Body #{index} (#{thread_label})" }
2482+
2483+
Thread.new do
2484+
posts.each.with_index do |article, index|
2485+
assert_encrypted_attribute article, :title, "Article #{index} (#{thread_label})"
2486+
article.decrypt
2487+
assert_not_encrypted_attribute article, :title, "Article #{index} (#{thread_label})"
2488+
end
2489+
end
2490+
end
2491+
end

0 commit comments

Comments
 (0)