-
Notifications
You must be signed in to change notification settings - Fork 47
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
Remove redundant tests #345
Conversation
create_table :mongo_documents do |t| | ||
t.string :name | ||
end | ||
end | ||
|
||
class NullableId < ActiveRecord::Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find any place where this class was being used. Let me know if I should restore it or try to create new tests with records that return nil on their primary_key
option.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
=======================================
Coverage 90.22% 90.22%
=======================================
Files 13 13
Lines 757 757
=======================================
Hits 683 683
Misses 74 74 ☔ View full report in Codecov by Sentry. |
This test seems to just use Marshal.dump on an object and then Marshal.load it later, which would pass for any ruby object.
This test seems to test that an object that is cached can be fetched back from the cache. As proof, the meilisearch method calls can be removed and the test passes just fine: ```ruby context 'with Rails caching' do let(:memory_store) { ActiveSupport::Cache.lookup_store(:memory_store) } let(:search_query) { '*' } let(:cache_key) { "book_search:#{search_query}" } before do allow(Rails).to receive(:cache).and_return(memory_store) Rails.cache.clear end fit 'caches the search results' do # Ensure the cache is empty before the test expect(Rails.cache.read(cache_key)).to be_nil # Perform the search and cache the results Rails.cache.fetch(cache_key) do search_query end # Check if the search result is cached expect(Rails.cache.read(cache_key)).to eq(search_query) end end ```
It does not seem like Mongoid::Document has bang methods, so this is spec is not reproducing a likely naming conflict. In either case, the plan is to test with real MongoDB models so this test would be removed eventually.
81a5741
to
355250e
Compare
Rebased to |
'is_synchronous' tests a private method and only tests that the configuration was applied 'has maxValuesPerFacet set' tests meilisearch-ruby's Index class
Closing in favor of only keeping #350, this PR didn't pan out like I expected and thus is not useful. |
Continues after #342: Please only look at commits after "Remove redundant Ebook model"More changes toward resolving #332
Please see commit messages for more information on why each test was removed.