Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Add a smoke test to make sure fixtures are not included
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 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
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 |