Giter VIP home page Giter VIP logo

learn-rails-7-rspec's Introduction

Rails 7 with Rspec 3 Example

This application is just an example of how to setup Rails 7 with Rspec 3 using Postgres.

Environment Variables

To use this app you will need to setup the following Environment variables so it can connect to the postgres database.

DB_HOST=localhost
DB_PORT=5432
DB_USER=
DB_PASSWORD=

Rspec

To run the rspec just type:

bin/rspec spec

This project also uses parallel test which is optional. Regular test without parallel finishes in around "Finished in 5.7 seconds (files took 4.27 seconds to load)" Parallel test with 8 processes will finish around 9 seconds. Why? Because it takes 6.32 seconds to scan all the test and then assign each cores specific sets of tests to perform. This number will also change from computer to computer. So parallel test are very useful when you have lots of tests.

If you do want to use parallel test then run the following commands first to setup the database.

bin/rails parallel:create
bin/rails parallel:prepare
bin/rails parallel:migrate

Once you are ready to test run

bin/rails parallel:spec

Remember that everytime you create a new migration file you must run

bin/rails parallel:migrate

learn-rails-7-rspec's People

Contributors

saimon-dp avatar saimonl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.