Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* run ci against rails 7.1 * change test_app name * make test app generation work with rails 7.1 and older * resolve ransack 'NoMethodError: undefined method ' * formtastic 'DEPRECATION WARNING: Calling silence on ActiveSupport::Deprecation is deprecated and will be removed from Rails' * do not check redirect body anymore because rails 7.1 removed it see rails/rails@c2e756a * temporal: resolve cucumber-rails DEPRECATION WARNING: Setting action_dispatch.show_exceptions to false is deprecated. Set to :none instead * enable reloading to be able to test 'class-reload in development' * bump devise from 4.9.2 to 4.9.3 * Fix tabs_spec flaky tests by allow lazy load of transliteration rules Run the following code prior this commit to see the error ``` rspec ./spec/unit/views/components/tabs_spec.rb:42 --seed 57923 ``` The error: ``` Failure/Error: result = string.parameterize I18n received :t with unexpected arguments expected: (:tab_key) got: (:"i18n.transliterate.rule", {:default=>{}, :locale=>:en, :resolve=>false}) Diff: @@ -1 +1 @@ -[:tab_key] +[:"i18n.transliterate.rule", {:default=>{}, :locale=>:en, :resolve=>false}] # /home/matias/.rvm/gems/ruby-3.2.2/gems/i18n-1.14.1/lib/i18n/backend/transliterator.rb:13:in `transliterate' # /home/matias/.rvm/gems/ruby-3.2.2/gems/i18n-1.14.1/lib/i18n.rb:298:in `transliterate' # /home/matias/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.0/lib/active_support/inflector/transliterate.rb:84:in `transliterate' # /home/matias/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.0/lib/active_support/inflector/transliterate.rb:125:in `parameterize' # /home/matias/.rvm/gems/ruby-3.2.2/gems/activesupport-7.1.0/lib/active_support/core_ext/string/inflections.rb:216:in `parameterize' # ./lib/active_admin/views/components/tabs.rb:35:in `fragmentize' # ./lib/active_admin/views/components/tabs.rb:19:in `build_menu_item' # ./lib/active_admin/views/components/tabs.rb:9:in `tab' ``` The problem? tab calls `parameterize` on the give title. That use `I18n.transliterate` under the hood which calls `I18n.t`. We must consider that call in our stub. Why is a flaky tests? Because `I18n` uses an internal cache. Only the first call to `I18n.transliterate` calls `I18n.t`. See https://github.com/rails/rails/blob/v7.1.1/activesupport/lib/active_support/core_ext/string/inflections.rb#L216 https://github.com/rails/rails/blob/v7.1.1/activesupport/lib/active_support/inflector/transliterate.rb#L123 https://github.com/rails/rails/blob/v7.1.1/activesupport/lib/active_support/inflector/transliterate.rb#L64 https://github.com/ruby-i18n/i18n/blob/v1.14.1/lib/i18n/backend/transliterator.rb#L13 * require ransack 4.1 * Revert "require ransack 4.1" This reverts commit 51f665e. This would force users to drop ruby 2.7
- Loading branch information