Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6: Fix randomly failing tests by loading models schema #800

Conversation

aidanharan
Copy link
Contributor

@aidanharan aidanharan commented May 6, 2020

Fixed randomly failing tests caused by models' schemas not already been loaded before tests were run. If the schema is not loaded then the loading of the schema causes the tests to fail as they cause unexpected queries to the database.

The use of .send(:load_schema) for this purpose is already used in the Rails tests https://github.com/rails/rails/blob/v6.0.2.2/activerecord/test/cases/null_relation_test.rb#L20

@aidanharan aidanharan marked this pull request as ready for review May 6, 2020 16:05
@wpolicarpo wpolicarpo merged commit 8ab0006 into rails-sqlserver:6-0-dev May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants