diff --git a/config/app.yml b/config/app.yml new file mode 100644 index 0000000..663c794 --- /dev/null +++ b/config/app.yml @@ -0,0 +1,15 @@ +default: &default + short_name: '# TODO: Change in config/app.yml' + title: '# TODO: Change in config/app.yml' + +development: + <<: *default + +test: + <<: *default + +staging: + <<: *default + +production: + <<: *default diff --git a/config/application.rb b/config/application.rb index fceb52a..d3d7c66 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,8 +22,9 @@ require 'sprockets/railtie' Bundler.require(*Rails.groups) module App - SHORT_NAME = 'app' # TODO: Update name - TITLE = 'TODO: Update in config/application.rb' + CONFIG = Application.configuration.x.app = config_for(:app) + SHORT_NAME = CONFIG.short_name + TITLE = CONFIG.title class Application < Rails::Application config.x.redis = config_for(:redis) diff --git a/config/environments/test.rb b/config/environments/test.rb index 6e7781d..1dd3a4e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -42,6 +42,8 @@ Rails.application.configure do # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr + config.log_level = :warn + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true end diff --git a/script/test b/script/test index af400e5..3f083f4 100755 --- a/script/test +++ b/script/test @@ -10,20 +10,8 @@ cd "$(dirname "$0")/.." export PROJECT_NAME="app_test" RAILS_ENV="test" RACK_ENV="test" -# setup test database -printf "\n===> Migrating $RAILS_ENV database ...\n" -printf "\n*************************************************************" -printf "\n********************** MIGRATION NOTE ***********************" -printf "\n** Script assumes database is already created **" -printf "\n** **" -printf "\n** Run the following command if error encountered **" -printf "\n** **" -printf "\n** docker-compose run -e RAILS_ENV=$RAILS_ENV app rake db:create **" -printf "\n** **" -printf "\n*************************************************************" -printf "\n*************************************************************\n" - -docker-compose run -e RAILS_ENV=$RAILS_ENV app rails db:environment:set +printf "\n===> Migrating database ...\n"; +docker-compose run -e RAILS_ENV=$RAILS_ENV app rails db:create db:schema:load db:migrate printf "\n===> Running tests ...\n"; @@ -33,4 +21,6 @@ else docker-compose run -e RAILS_ENV=$RAILS_ENV app rspec fi -docker-compose down +printf "\n===> Removing app instances ...\n"; +docker-compose stop +docker rm $(docker ps -a -q --filter="name=*_app_run*")