rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
968 stars 558 forks source link

Fixed tests #1167

Closed aidanharan closed 1 month ago

aidanharan commented 2 months ago
  1. Coerce HasManyThroughAssociationsTest#test_associate_existing test as MSSSQL has no release savepoint query.
HasManyThroughAssociationsTest#test_associate_existing [/usr/local/bundle/bundler/gems/rails-087260d0fce3/activerecord/test/cases/associations/has_many_through_associations_test.rb:224]:
2 instead of 3 queries were executed. Queries: SAVE TRANSACTION active_record_1

EXEC sp_executesql N'INSERT INTO [readers] ([post_id], [person_id]) OUTPUT INSERTED.[id] VALUES (@0, @1)', N'@0 int, @1 int', @0 = 2, @1 = 2.
Expected: 3
  Actual: 2

bin/rails test /usr/local/bundle/bundler/gems/rails-087260d0fce3/activerecord/test/cases/associations/has_many_through_associations_test.rb:220

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/8928362210/job/24523775374

  1. Fixed RelationMergingTest#test_merge_doesnt_duplicate_same_clauses_coerced.

Fix required because of https://github.com/rails/rails/pull/51139

  1. Coerced QueryLogsTest#test_sqlcommenter_format_allows_string_keys and reimplemented.

  2. Fixed SanitizeTest#test_sanitize_sql_like_example_use_case_coerced.

  3. Fixed CalculationsTest#test_count_for_a_composite_primary_key_model_with_includes_and_references. Ported change from https://github.com/rails/rails/pull/51655