Our First Test using RSpec
Explore how to create and run your first RSpec test for the User model in a Dockerized Rails application. Understand the process of generating specs, modifying the User model to pass tests, and running tests with docker-compose commands to integrate testing smoothly in your Docker workflow.
We'll cover the following...
We'll cover the following...
Generating spec for our User model
Having installed RSpec in our project, it is not very satisfying to see zero tests running. Let’s rectify that right now by creating our first test so that we can see some actual test code running.
To generate a spec for our User model, we have used:
$ docker-compose exec web bin/rails generate rspec:model user
create ...