Fix to rescue ActiveRecord::ConnectionNotEstablished in available_locales - #134
Open
takahashim wants to merge 1 commit into
Open
takahashim wants to merge 1 commit into
takahashim wants to merge 1 commit into
Conversation
takahashim
marked this pull request as ready for review
August 8, 2026 17:19
Contributor
Author
|
I'm not sure why the test is failing, but the $ bundle exec rspec spec/lib/decidim/term_customizer/i18n_backend_spec.rb
Randomized with seed 21223
Decidim::TermCustomizer::I18nBackend
#translations
returns the correct translations list
#translate
calls lookup
with actual translations
translates the translation keys correctly
with plural forms
translates the translation keys correctly
#initialized?
when translations are loaded
returns true
when translations are not loaded
returns false
#available_locales
when translations are available
returns an empty result
when the translation query raises ActiveRecord::ConnectionNotEstablished
returns an empty result
when the translation query raises ActiveRecord::StatementInvalid
returns and empty result
when no translations are available
returns an empty result
#reload!
resets the translations
Top 10 slowest examples (2.19 seconds, 16.7% of total time):
Decidim::TermCustomizer::I18nBackend#available_locales when translations are available returns an empty result
1.24 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:65
Decidim::TermCustomizer::I18nBackend#translate with plural forms translates the translation keys correctly
0.92439 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:175
Decidim::TermCustomizer::I18nBackend#translations returns the correct translations list
0.02311 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:137
Decidim::TermCustomizer::I18nBackend#available_locales when the translation query raises ActiveRecord::ConnectionNotEstablished returns an empty result
0.00293 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:81
Decidim::TermCustomizer::I18nBackend#initialized? when translations are loaded returns true
0.00176 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:106
Decidim::TermCustomizer::I18nBackend#translate calls lookup
0.00151 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:143
Decidim::TermCustomizer::I18nBackend#reload! resets the translations
0.0012 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:121
Decidim::TermCustomizer::I18nBackend#available_locales when the translation query raises ActiveRecord::StatementInvalid returns and empty result
0.00087 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:71
Decidim::TermCustomizer::I18nBackend#available_locales when no translations are available returns an empty result
0.0008 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:51
Decidim::TermCustomizer::I18nBackend#translate with actual translations translates the translation keys correctly
0.00078 seconds ./spec/lib/decidim/term_customizer/i18n_backend_spec.rb:157
Finished in 13.14 seconds (files took 4.47 seconds to load)
11 examples, 0 failures
Randomized with seed 21223 |
This file contains hidden or 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
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.
Fixes #133