From 940ef5b92fb38965f41859a9ffc46999efda6e4c Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 26 Aug 2019 15:05:24 +0200 Subject: [PATCH] Fix Travis email config [SCI-3786] --- Makefile | 2 +- config/environments/development.rb | 27 ++++++--------------------- config/environments/test.rb | 4 +++- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 74bf6a2cb..7e3a6484f 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ tests-ci: @docker-compose run --rm web bash -c "bundle install && yarn install" @docker-compose up -d webpack @docker-compose ps - @docker-compose run -e ENABLE_EMAIL_CONFIRMATIONS=false -e RAILS_ENV=test -e PAPERCLIP_HASH_SECRET=PAPERCLIP_HASH_SECRET -e MAIL_SERVER_URL=localhost:3000 -e ENABLE_RECAPTCHA=false -e ENABLE_USER_CONFIRMATION=false -e ENABLE_USER_REGISTRATION=true -e CORE_API_RATE_LIMIT=1000000 --rm web bash -c "RAILS_ENV=test; rake db:create db:migrate && rake db:migrate && yarn install && bundle exec rspec && bundle exec cucumber" + @docker-compose run -e ENABLE_EMAIL_CONFIRMATIONS=false -e MAIL_FROM=MAIL_FROM -e MAIL_REPLYTO=MAIL_REPLYTO -e RAILS_ENV=test -e PAPERCLIP_HASH_SECRET=PAPERCLIP_HASH_SECRET -e MAIL_SERVER_URL=localhost:3000 -e ENABLE_RECAPTCHA=false -e ENABLE_USER_CONFIRMATION=false -e ENABLE_USER_REGISTRATION=true -e CORE_API_RATE_LIMIT=1000000 --rm web bash -c "rake db:create db:migrate && rake db:migrate && yarn install && bundle exec rspec && bundle exec cucumber" console: @$(MAKE) rails cmd="rails console" diff --git a/config/environments/development.rb b/config/environments/development.rb index 345984ca4..daa7bdf8a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -7,11 +7,7 @@ Rails.application.configure do # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - if ENV['CUCUMBER'] == 'cucumber' - config.cache_classes = true - else - config.cache_classes = ENV['WORKER'] ? true : false - end + config.cache_classes = ENV['WORKER'] ? true : false # Do not eager load code on boot. config.eager_load = ENV['WORKER'] ? true : false @@ -28,22 +24,11 @@ Rails.application.configure do reply_to: Rails.application.secrets.mailer_reply_to } - if ENV['CUCUMBER'] == 'cucumber' - config.action_mailer.delivery_method = :test - # Don't care if the mailer can't send. - config.action_mailer.default_url_options = { - host: Rails.application.secrets.mail_server_url, - port: 3001 - } - config.action_mailer.perform_deliveries = true - else - config.action_mailer.delivery_method = :smtp - # Don't care if the mailer can't send. - config.action_mailer.default_url_options = { - host: Rails.application.secrets.mail_server_url - } - config.action_mailer.perform_deliveries = false - end + config.action_mailer.delivery_method = :smtp + config.action_mailer.default_url_options = { + host: Rails.application.secrets.mail_server_url + } + config.action_mailer.perform_deliveries = false config.action_mailer.smtp_settings = { address: Rails.application.secrets.mailer_address, diff --git a/config/environments/test.rb b/config/environments/test.rb index 96489aac9..a55824d4e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -55,12 +55,14 @@ Rails.application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + config.action_mailer.perform_deliveries = true + Rails.application.routes.default_url_options = { host: Rails.application.secrets.mail_server_url } # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true # Randomize the order test cases are executed. config.active_support.test_order = :random