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
Integration tests should work with the login method
Actual Behavior
All tests work under Rails 5.4.
Under Rails 6.0 , tests that inherit from ActionController::TestCase work just fine.
However, tests that inherit from ActionDispatch::IntegrationTest do not work. The result is Filter chain halted as :require_login rendered or redirected
requireFile.expand_path('../../config/environment',__FILE__)require'rails/test_help'require'capybara/rails'classActiveSupport::TestCaseincludeSorcery::TestHelpers::Rails::IntegrationincludeSorcery::TestHelpers::Rails::Controller# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.fixtures:allCapybara.server=:puma# Until your setup is workingCapybara.default_driver=:selenium_chrome# Add more helper methods to be used by all tests here...deflogin_user(user)# post the login and follow throughpost"/sessions",params: {email: user.email,password: user.password}putsuser.inspectfollow_redirect!enddefauthenticate_user(user=users(:one))postsessions_url,params: {email: user.email,password: "hac56wsn"}assert_equalsession[:user_id].to_i,user.idendend
The text was updated successfully, but these errors were encountered:
@legacy370 Based on the information provided, it seems difficult to identify the cause of the issue. Could you provide complete, unabridged code that reproduces the problem?
Configuration
Expected Behavior
Integration tests should work with the login method
Actual Behavior
All tests work under Rails 5.4.
Under Rails 6.0 , tests that inherit from ActionController::TestCase work just fine.
However, tests that inherit from ActionDispatch::IntegrationTest do not work. The result is Filter chain halted as :require_login rendered or redirected
Steps to Reproduce
And here's the test_helper
The text was updated successfully, but these errors were encountered: