diff --git a/Gemfile b/Gemfile index 7598b21..d71faf7 100644 --- a/Gemfile +++ b/Gemfile @@ -101,6 +101,7 @@ group :test do # for test coverage report gem 'simplecov', require: false + end # Attach comments to Active Record queries diff --git a/config/initializers/email_interceptor.rb b/config/initializers/email_interceptor.rb index 8698baf..158356b 100644 --- a/config/initializers/email_interceptor.rb +++ b/config/initializers/email_interceptor.rb @@ -1,5 +1,5 @@ -if Settings.intercept_and_forward_emails_to.present? - options = { forward_emails_to: Settings.intercept_and_forward_emails_to, +if Rails.application.secrets.intercept_and_forward_emails_to.present? + options = { forward_emails_to: Rails.application.secrets.intercept_and_forward_emails_to, deliver_emails_to: ['@example.com'] } interceptor = MailInterceptor::Interceptor.new(options) diff --git a/test/controllers/superadmin/users_controller_test.rb b/test/controllers/superadmin/users_controller_test.rb index 646df8a..02ca747 100644 --- a/test/controllers/superadmin/users_controller_test.rb +++ b/test/controllers/superadmin/users_controller_test.rb @@ -16,4 +16,21 @@ def test_index_when_user_is_not_superadmin assert_response :forbidden end + def test_edit_user_modal_success_response + user = users :admin + sign_in user + get :edit, id: users(:nancy) + assert_response :success + end + + def test_user_update_success + admin = users :admin + sign_in admin + nancy = users :nancy + + post :update, id: nancy, user: {first_name: 'Jane'} + nancy.reload + + assert 'Jane', nancy.first_name + end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 258d711..61536b9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,4 @@ + def enable_test_coverage require 'simplecov'