-
-
Notifications
You must be signed in to change notification settings - Fork 130
Use optimized loading of default configuration for test / development environments #284
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ gem 'rails' | |
| gem 'sqlite3' | ||
| # Use Puma as the app server | ||
| gem 'puma' | ||
|
|
||
| gem 'devise', github: 'heartcombo/devise', branch: 'main' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @waiting-for-dev I thought that making the test suite run against the main branch of this goes hand in hand with otherwise it won't work @waiting-for-dev |
||
| # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
| # gem 'jbuilder', '~> 2.5' | ||
| # Use ActiveModel has_secure_password | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,4 +30,10 @@ | |
|
|
||
| RSpec.configure do |config| | ||
| config.use_transactional_fixtures = true | ||
|
|
||
| # Make sure routes are loaded once before the test suite is run | ||
| # Since they are lazy loaded by default on Rails 8 | ||
| config.before(:suite) do | ||
| Rails.application.try(:reload_routes_unless_loaded) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chaadow , I'm wondering if users will also need to add this to their test suite to make them happy 🤔
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only those on Rails 8 and above ( because of lazy routes loading ), but most of us that are on rails 8 use the "main/master" version of because if you look at the changelog: https://github.com/heartcombo/devise/blob/main/CHANGELOG.md everything is "well supported" but it's still not released yet. and since this gem tests against the most recent version of devise ( on rubygems,) I did this workaround to make the tests pass! Your call @waiting-for-dev 🙏🏼
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha. How about this: we could put it behind a configuration option that's disabled by default. That way, we wouldn't break anyone's existing test suites. But folks who are aware of these quirks could enable it and add the call to their spec_helper file. What do you think? It'd also be good to add a notice in the README. Once Devise releases a new version, we can clean it up.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, for our test suite, we can probably just
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @waiting-for-dev you are definitely right! I've just tested it and without it it fails. I also made a slight optimization to run it
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @chaadow , just wanted to make sure you read this from above:
No hurries on my end, but I wouldn't like you to be left waiting for me |
||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know i've made this change in this PR a while ago : ( #275 )
But I think we're finally ready to support devise 5. and seeing that they can cut a release at any moment ( based on the changelog i've sent below) @waiting-for-dev