Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix incompatibility with rack-test 2.0 #64

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

juno
Copy link

@juno juno commented Jul 2, 2022

This fixes the following error when calling expire_cookies with rack-test 2.0:

     NoMethodError:
       undefined method `cookie_jar' for nil:NilClass
             @rack_test_driver.browser.current_session.instance_variable_get(:@rack_mock_session).cookie_jar
                                                                                                 ^^^^^^^^^^^

See rack/rack-test#297 for details about rack-test side changes.

I know that this gem has abandoned, however hope this helps for others.

@olleolleolle
Copy link
Contributor

olleolleolle commented Jul 11, 2022

Thanks, this fixed my issue!

Workaround snippet to use this branch:

gem "show_me_the_cookies", github: "juno/show_me_the_cookies", branch: "fix-compatibility-with-rack-test-2.0" # LOCKED: When this PR is merged/released, unlock: https://github.com/nruth/show_me_the_cookies/pull/64

@emresimtay
Copy link

emresimtay commented Jul 12, 2022

Hello there :)

The above solution fixed the issues created from undefined method cookie_jar for nil:NilClass When do you think this will be released?

Many thanks frens 🥇

p.s.
this also seems to fixed my tests :)
@rack_test_driver.browser.current_session.instance_variable_get(:@cookie_jar)

Copy link

@emresimtay emresimtay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI that accessing cookie jar directly from the current_session isn't backward compatible but I assume this will not be a problem 🤷

@mfittko
Copy link

mfittko commented Jul 14, 2022

@nruth I think this should be released soon, we were also stumbling over this as we did not have rack-test locked and since we had to upgrade rails due to the latest CVE, we ran into this issue. Sure this will happen to more ppl. Thanks for the fix/review @juno @emresimtay

@nruth nruth merged commit ff1fe59 into nruth:master Jul 14, 2022
@nruth
Copy link
Owner

nruth commented Jul 14, 2022

Looks good. BC isn't a problem, it'll be part of a major release.

@juno
Copy link
Author

juno commented Jul 15, 2022

@nruth Thank you for releasing quickly! 🎉

@juno juno deleted the fix-compatibility-with-rack-test-2.0 branch July 15, 2022 01:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants