-
Notifications
You must be signed in to change notification settings - Fork 29
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
Missing callback function with devise integration #18
Comments
Hello. And It shouldn't.
Write usual scenario if you want to test what happens with user on sign in . E.g feature 'Login' do
scenario 'User logs in to' do
visit '/users/sign_in'
fill_in :email, with: 'a@b.com'
fill_in :password, with: 'secret'
click_button 'Log in'
expect(page).to have_content('After login...')
end
end Another tip: use rspec-example_steps for writing read-able acceptance scenarios. . |
Hi, I didn't agree when you say that it shouldn't, because what happend in "after_sign_in_path_for" can change expected values that you have to check after the login. i.e. I'm a user (not logged in) and I have a cart with items. When I'm log in, I need that devise assign the cart to me. That's possible with "after_sign_in_path_for" and it will change the expected content of the page. Maybe you have a work around for case like this ? |
No. You are wrong. It's not an argument. Rack session access is and will be agnostic from any authentication gem. The goal is to provide read/write access to application session. Nothing more. No special magic for devise, authlogic or any gem. The If you need to check special behavior after user is signed in - write corresponding scenarios (see above). Thats all folks. |
I totally agree with you @ayanko. @ckornaros if you want |
Closed as invalid. |
Hi,
I use your helper with devise for my test :
module FeatureHelpers
def logged_as(user)
page.set_rack_session('warden.user.user.key' => User.serialize_into_session(user).unshift("User"))
end
end
It works good but I notice that set_rack_session dosen't call the device callback function => "after_sign_in_path_for"
More information here : https://github.com/plataformatec/devise/wiki/How-To%3A-Redirect-to-a-specific-page-on-successful-sign-in-and-sign-out
Do you think you can fix this ?
By the way thank you for your good work :)
The text was updated successfully, but these errors were encountered: