Skip to content

Backend Automated Testing

Julia Nguyen edited this page Dec 9, 2024 · 9 revisions

All Tests

rspec

When using Docker, run:

$ docker-compose -f docker-compose.test.yml build
$ docker-compose -f docker-compose.test.yml run app bundle exec rspec

Specific Tests

Specific File

rspec ./spec/services/profile_picture_spec.rb

Specific Block/Line

rspec ./spec/services/profile_picture_spec.rb:16

Specific Test

Add the :focus attribute to any of it, context, describe, or test to only run the tests in that context.

it 'renders the index template', :focus do
  get strategies_path
  expect(response).to render_template('index')
end

Running plain old rspec will now ONLY run this test

This is enabled by config.filter_run_when_matching :focus in spec/spec_helper.rb

Clone this wiki locally