Skip to content

Running tests

Andy edited this page Feb 16, 2019 · 10 revisions

Note: it is a good idea to occasionally run:

bundle exec rake db:test:prepare

Integration Tests

Ensure that you have redis running locally:

redis-server &

Then run Cucumber tests with:

bundle exec cucumber features

To run Cucumber tests headless (in order for @javascript tests to pass)

xvfb-run bundle exec cucumber features

To run tests for a single feature:

bundle exec cucumber features/badges/earn_consistency_badge.feature --require features

JavaScript Tests

  • From command line:

    RAILS_ENV=test bundle exec rake spec:javascript

  • From browser:

    Navigate to http://localhost:3000/specs while Rails server is running (bundle exec rails s).

Unit Tests

bundle exec rspec

or to run a single spec

bundle exec rspec spec/models/memverse_spec.rb