testdouble/cypress-rails

Document test data management

Closed this issue · 1 comments

What I've done for test data management (with surprising success so far) is:

  • config/routes.rb that are only drawn if RAILS_ENV is "test"
  • A specific app/controllers/test_states_controller.rb that becomes a dumping ground for any test state management I need from cypress
  • Cypress before and beforeEach hooks that call cy.request('POST', 'test_states/database/clean_slate') or similar to interactively wipe the database between runs

We ought to document this since 90% of users will run into the same issue

Fixed by 0.1.0