-
Notifications
You must be signed in to change notification settings - Fork 69
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
(WIP) Refactor tests #108
Closed
Closed
(WIP) Refactor tests #108
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4d8b586
to
ba6be0d
Compare
464c3db
to
47000d9
Compare
4122db1
to
1c3f9ea
Compare
a135849
to
936771e
Compare
Basic tests for associations defined as: ```ruby has_many :children_one has_many :children_two, through: :join_table ```
When models are created fresh for each test the configuration may be cached by ActiveSupport. This results in tests failing if they are executed after others that use the same model names with different associations. The method for caching this information was changed for Rails 7 meaning that is is no longer necessary to explicitly clear the cache. The change was made here: rails/rails@14d4edd
These may be superfluous. It is effectively testing Amoeba on the intermediate Child model rather than on the Parent table, which has the has_one/through association.
To help with refactoring of the tests, `docs/associations.md` contains a table showing which configuration options are covered in the spec files for each of the association types: * `has_one` * `has_many` * `has_and_belongs_to_many`
Closing in favour of a more gradual approach. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Making the specs clearer by splitting them out into tests that each check a single thing. Ultimately, the goal is to remove
spec/lib/amoeba_spec.rb
while maintaining the same test coverage.Some bugs have been discovered during this refactor; #106, #107
To do