-
Notifications
You must be signed in to change notification settings - Fork 143
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
RSpec: cannot call non-localized routes name #267
Comments
Hi, could you please provide more details? I need the version of RSpec, its configuration, and the type of the spec executed. A GitHub repository with a minimum reproducible test case would be appreciated I think this may be related to #140 |
All my gems are up to date and my specs are of
It doesn't require any specific configuration. Let me know if a test repo is still required. I will try to find one hour to build one as I can't possibly share our client's projetcs |
Of course. Also, it should be a minimum reproducible test case, without extra gems and with the minimum amount of code to reproduce the issue You can fork https://github.com/diowa/ruby3-rails7-bootstrap-heroku/ and add the minimum amount of code to the |
Closing here because of missing feedback |
Hi, sorry I never came back but in case anyone is wondering the samething here is the fix I had # spec/support/route_translator.rb
module AutomatedLocale
extend ActiveSupport::Concern
included do
def process(action, method: "GET", params: nil, session: nil, body: nil, flash: {}, format: nil, xhr: false, as: nil) # rubocop:disable Metrics/ParameterLists, Layout/LineLength
params ||= {}
params[:locale] = I18n.locale.to_s unless params.key?(:locale)
super
end
end
end
ActionController::TestCase::Behavior.include AutomatedLocale |
Configuration
Steps to reproduce*
Use a named_path without the locale in the name in RSpec
Expected behavior*
Should behave just like outside specs.
Actual behavior*
It crashes
System configuration*
Rails version: 7.0.1
Ruby version: 3.0.1
Route Translator version: 12.1.0
The text was updated successfully, but these errors were encountered: