From 10382093b5fb8231329b712d3757ed95d1ede3cd Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Tue, 2 Jan 2024 17:52:31 +0100 Subject: [PATCH] Extend Contributing section --- README.md | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 28d980f..ae1a974 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,11 @@ Quantified self -* Ruby version: 2.7 +* Ruby version: 3.1 * System dependencies: none + ## Installation git clone https://gitea.michalczyk.pro/fixin.me/fixin.me.git @@ -13,6 +14,7 @@ Quantified self bundle install + ## Configuration cp -a config/application.rb.dist config/application.rb @@ -20,6 +22,7 @@ Quantified self Modify configuration settings below `SETUP` comment appropriately. + ## Database Grant database user and privileges: @@ -38,6 +41,7 @@ Run database creation and migration tasks: RAILS_ENV="production" bundle exec rake db:create db:migrate db:seed + ## Running @@ -53,12 +57,13 @@ and specify server IP/port, either with `port` or `bind`, e.g.: Run server - RAILS_ENV="production" bin/rails s + bundle exec rails s -e production ### Apache mod_passenger + ## Contributing @@ -73,15 +78,29 @@ possibly with different Ruby versions: mysql> flush privileges; -### Environment +### Development environment -Use `RAILS_ENV="development"` for rake commands and running rails server. +Starting application server in development environment: -Use `RAILS_ENV="test"` for running tests. + bundle exec rails s -e development + +For running rake tasks, prepend command with environment: + + RAILS_ENV="development" bundle exec rake ... ### Running tests -Single test: +Tests need to be run from within toplevel application directory: - bin/rails test test/system/users_test.rb --name test_register +* all system tests: + + bundle exec rails test:system + +* all tests from one file, with optional seed: + + bundle exec rails test test/system/users_test.rb --seed 1234 + +* single test, with optional seed: + + bundle exec rails test test/system/users_test.rb --name test_register --seed 1234