rails new <project_name> -d postgresql -T
-T
, [--skip-test], [--no-skip-test] # Skip test files-d
, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
- In the Gemfile: group :development, :test do gem 'factory_bot_rails' gem 'rspec-rails' gem 'shoulda-matchers' end
group :development do gem 'simplecov', require: false end
-
Run $ bundle install rails generate rspec:install
-
In
spec/rails_helper.rb
Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end -
At the top of
rails_helper
require 'simplecov' SimpleCov.start -
Docker Compose File
version: '3.8'
services: db: container_name: nps_service_postgres image: postgres restart: always environment: POSTGRES_USER: root POSTGRES_PASSWORD: root POSTGRES_DB: nps_service ports: - '5432:5432' volumes: - ./tmp/postgres-data:/var/lib/postgresql/data
pgadmin: container_name: nps_service_pgadmin4_container image: dpage/pgadmin4 restart: always environment: PGADMIN_DEFAULT_EMAIL: [email protected] PGADMIN_DEFAULT_PASSWORD: root ports: - '5050:80' volumes: - ./tmp/postgres-data:/var/lib/pgadmin
volumes: postgres-data: