You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calls to `ActiveResource::HttpMock.respond_to` without arguments reset
the mock, clearing previously defined request-response pairs.
Invocations with a final positional argument of `false` **do not clear**
previously defined request-response mocks. This behavior can be useful
for tests that require a sequence of Http mock definitions.
Regardless of the style of invocation, the collection of mocks should be
reset between individual tests, so that mock state does not leak into
subsequent test cases, which has the potential to cause unpredictable
behavior and flaky tests.
This change defines an `ActiveSupport.on_load` hook to execute for
`ActiveSupport::TestCase` instances. The hook defines a [teardown][]
block to invoke `ActiveResource::HttpMock#reset!` between test cases.
[teardown]: https://edgeapi.rubyonrails.org/classes/ActiveSupport/Testing/SetupAndTeardown/ClassMethods.html#method-i-teardown
0 commit comments