Skip to content

Commit

Permalink
Fix WrongScopeError when use_active_record = false
Browse files Browse the repository at this point in the history
Fixes #2417
  • Loading branch information
pirj committed Jan 14, 2021
1 parent 5b0bdd0 commit 6167064
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/rspec/rails/fixture_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ module FixtureSupport
include RSpec::Rails::MinitestAssertionAdapter
include ActiveRecord::TestFixtures

if ::Rails.version.to_f >= 6.1
# @private return the example name for TestFixtures
def name
@example
end
end

included do
if RSpec.configuration.use_active_record?
include Fixtures
Expand Down Expand Up @@ -50,13 +57,6 @@ def proxy_method_warning_if_called_in_before_context_scope(method_name)
end
end
end

if ::Rails.version.to_f >= 6.1
# @private return the example name for TestFixtures
def name
@example
end
end
end
end
end
Expand Down

0 comments on commit 6167064

Please sign in to comment.