Skip to content

Writing Tests

Peeyush Goyal edited this page Sep 2, 2021 · 6 revisions

Writing Tests in Rails

Testing all worst case possibilities is good before we are staging to Production.

We have used rspec-rails, factory_bot_rails and faker to setup our basic tests.

  1. If you are using WSL then use WSL 1, network connection is not possible in WSL 2
  2. For running integration tests use these commands:
  1. sudo service postgresql start
  2. rails db:reset RAILS_ENV=test
  3. bundle exec rspec file path
  1. We are using Capybara for writing tests, Capybara Cheatsheet https://gist.github.com/zhengjia/428105
Clone this wiki locally