-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow enabling/disabling IronTrail in rspec #9
Conversation
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.
left some thoughts and suggestions, but it's looking good
@enabled = true | ||
end | ||
|
||
def disable! |
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.
It's unlikely to happen since you need to require this, but one might do it in a rails console, I'd like iron_trail to protect me from doing this in production
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.
agreed. I'll add a protection if ENV['RAILS_ENV'] == 'production'
|
||
require 'iron_trail/testing/rspec' | ||
|
||
IronTrail::Testing.disable! |
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.
suggestion: also add a test where it is enabled by default, to ensure that iron_trail: false
is working properly
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.
@peterbrendel done in dd27096
Co-authored-by: Peter Brendel <[email protected]>
if ENV['RAILS_ENV'] == 'production' | ||
raise 'This file should not be required in production. ' \ | ||
'Change the RAILS_ENV env var temporarily to override this.' | ||
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.
Would raising here stop the application from booting?
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.
yep 👍
Jira task
This PR adds functionality to enable/disable IronTrail in specs. See the README.md diff for more detail.