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
Add configuration to surpress active_record checks #2266
Changes from all commits
8ebdb6f
01adcb0
beda644
4e18dc3
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Pretend that ActiveRecord::Rails is defined and this doesn't blow up | ||
# with `config.use_active_record = false`. | ||
# Trick the other spec that checks that ActiveRecord is | ||
# *not* defined by wrapping it in RSpec::Rails namespace | ||
# so that it's reachable from RSpec::Rails::FixtureSupport. | ||
# NOTE: this has to be defined before requiring `rails_helper`. | ||
module RSpec | ||
module Rails | ||
module ActiveRecord | ||
module TestFixtures | ||
end | ||
end | ||
end | ||
end | ||
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. It's like that since the original problem was that I've double-checked that this test does blow up if 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. I tried hard, but couldn't make this example repo work to reproduce the original issue. Mostly due to bundler 1/2 problem, and then dependencies hell with Rails version which I had to update to 5.2, and in the end with missing |
||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe 'Example App', :use_fixtures, type: :model do | ||
it "does not set up fixtures" do | ||
expect(defined?(fixtures)).not_to be | ||
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.
?
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.
Added another spec to the smoke app. Should it be done differently?
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.
Sorry no, I read this as being identical several times, must be getting late 😂
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 was confused as well when I've finished typing its name 😆