This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_flash_types :primary, :secondary, :success, :danger, :warning, :info, :light, :dark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # spec/system/support/login_helpers.rb | |
| # See this blog post for setup guide: https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing | |
| module LoginHelpers | |
| def login_as(user) | |
| # Craft session cookie to make request authenticated (to pass even routing constraints) | |
| # Compilation of these: | |
| # - https://dev.to/nejremeslnici/migrating-selenium-system-tests-to-cuprite-42ah#faster-signin-in-tests | |
| # - https://turriate.com/articles/2011/feb/how-to-generate-signed-rails-session-cookie | |
| # - https://github.com/rails/rails/blob/43e29f0f5d54294ed61c31ddecdf76c2e1a474f7/actionpack/test/dispatch/cookies_test.rb#L350 |
OlderNewer