Skip to content

Files

Latest commit

 

History

History
37 lines (27 loc) · 568 Bytes

Rails-RedundantTravelBack.md

File metadata and controls

37 lines (27 loc) · 568 Bytes

Pattern: Redundant travel_back call

Issue: -

Description

Checks for redundant travel_back calls. Since Rails 5.2, travel_back is automatically called at the end of the test.

Examples

# bad
def teardown
  do_something
  travel_back
end

# good
def teardown
  do_something
end

# bad
after do
  do_something
  travel_back
end

# good
after do
  do_something
end

Further Reading