Skip to content

Commit

Permalink
Remove dependency on upsert in test
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Sep 26, 2023
1 parent 2ccb037 commit c571dc5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2474,3 +2474,18 @@ def invalid_add_column_option_exception_message(key)
end
end
end

# SQL Server does not support upsert. Removed dependency on `insert_all` that uses upsert.
class ActiveRecord::Encryption::ConcurrencyTest < ActiveRecord::EncryptionTestCase
def thread_encrypting_and_decrypting(thread_label)
posts = 100.times.collect { |index| EncryptedPost.create! title: "Article #{index} (#{thread_label})", body: "Body #{index} (#{thread_label})" }

Thread.new do
posts.each.with_index do |article, index|
assert_encrypted_attribute article, :title, "Article #{index} (#{thread_label})"
article.decrypt
assert_not_encrypted_attribute article, :title, "Article #{index} (#{thread_label})"
end
end
end
end

0 comments on commit c571dc5

Please sign in to comment.