Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2266 from rspec/configure-active-record
Add configuration to surpress active_record checks
- Loading branch information
Showing
7 changed files
with
103 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
example_app_generator/no_active_record/spec/verify_no_fixture_setup_spec.rb
This file contains 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
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 | ||
|
||
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 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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