Skip to content

Commit

Permalink
Provide non regression feature test when ActiveRecord::Base is loaded
Browse files Browse the repository at this point in the history
It happens if the AR::Base as already been loaded.

For example:
DatabaseCleaner/database_cleaner-active_record#91
  • Loading branch information
benoittgt committed Nov 23, 2023
1 parent 056162a commit 801d611
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions features/initializers.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: properly integrate with Rails and other gems

Background:
When I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
And I run `bundle install` with a clean environment

Scenario: handle already loaded ActiveRecord::Base by another gems earlier
When I run the following commands:
"""bash
cat config/application.rb
sed -i -e '/require "rails\/test_unit\/railtie"/a\'$'\n''require "active_record/base"' config/application.rb
"""
When I run `bundle exec rake test` with a clean environment
Then the output should contain "0 runs"

0 comments on commit 801d611

Please sign in to comment.