it 'does not register an offense when `subject` as an argument' do
expect_no_offenses(<<~RUBY)
RSpec.describe Foo do
it do
expect { create(:bar, baz: subject) }.to change { A.count }
expect { create(:bar, subject) }.to not_change { A.count }
end
end
RUBY
end
Resulted in a RSpec/RepeatedSubjectCall: Calls to subject are memoized, this block is misleading error message.
Related to https://github.com/rubocop/rubocop-rspec/issues/1821
Example test-case
Resulted in a
RSpec/RepeatedSubjectCall: Calls to subject are memoized, this block is misleading
error message.Expected result: error should not be reported.