You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rails _7.0.0_ new sample_app
rails generate scaffold Contact email
# run test, all passing# add this gem# configure it like described under [usage](https://github.com/svenfuchs/routing-filter#usage) section# add `RoutingFilter.active = false` to test_helper.rb# run tests again
rails test test/controllers/contacts_controller_test.rb
# it will fails with
Expected response to be a redirect to <http://www.example.com/contacts/980190963> but was a redirect to <http://www.example.com/en/contacts/980190963>.
Expected "http://www.example.com/contacts/980190963" to be === "http://www.example.com/en/contacts/980190963".
Expected behavior
When I add RoutingFilter.active = false to test_helper.rb all generated controller or route tests are passing.
or:
Add description in the README, how to use this gem with recommended way to setting the locale from URL params.
Actual behavior
In generated *ContactsControllerTest < ActionDispatch::IntegrationTest all assertions like assert_redirected_to contact_url(Contact.last) or assert_redirected_to contacts_url will fail.
Workaround
I find out, that instead of adding RoutingFilter.active = false to test_helper.rb I had to add RoutingFilter::Locale.include_default_locale = false.
The text was updated successfully, but these errors were encountered:
In the Usage section, under Tests, it says that
And if I do so, it breaks the recommended way to Setting the Locale from URL Params, as described in the Rails I18n Guides.
Step to reproduce
Expected behavior
When I add
RoutingFilter.active = false
totest_helper.rb
all generated controller or route tests are passing.or:
Add description in the
README
, how to use this gem with recommended way to setting the locale from URL params.Actual behavior
In generated
*ContactsControllerTest < ActionDispatch::IntegrationTest
all assertions likeassert_redirected_to contact_url(Contact.last)
orassert_redirected_to contacts_url
will fail.Workaround
I find out, that instead of adding
RoutingFilter.active = false
totest_helper.rb
I had to addRoutingFilter::Locale.include_default_locale = false
.The text was updated successfully, but these errors were encountered: