From 81906319ea905d73a20028c7dd4f25c2bdea1f26 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 7 Jan 2025 13:18:16 +0800 Subject: [PATCH] chore: update thruster gem and configure smtp settings - Upgrade thruster gem to version 0.1.10 - Set SMTP user credentials for sending emails - Adjust test to verify only activated users are displayed These updates improve email handling and ensure that the application uses the latest version of the thruster gem, while also refining the user index test to accurately reflect the activated state. --- Gemfile.lock | 10 +++++----- config/credentials.yml.enc | 2 +- config/environments/production.rb | 14 +++++++------- test/integration/users_index_test.rb | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0479d72..353a6c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -385,11 +385,11 @@ GEM railties (>= 6.0.0) stringio (3.1.2) thor (1.3.2) - thruster (0.1.9) - thruster (0.1.9-aarch64-linux) - thruster (0.1.9-arm64-darwin) - thruster (0.1.9-x86_64-darwin) - thruster (0.1.9-x86_64-linux) + thruster (0.1.10) + thruster (0.1.10-aarch64-linux) + thruster (0.1.10-arm64-darwin) + thruster (0.1.10-x86_64-darwin) + thruster (0.1.10-x86_64-linux) timeout (0.4.3) turbo-rails (2.0.11) actionpack (>= 6.0.0) diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index dd63333..e4f1413 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -TslEA5UQSRfZkSWazpaQn0ZtGZWIEepP6PfYJAqt11pIJ7dcPZIoL3AVXp4nLYkfDQV6hSv45MVNFS5RpGIHF+M5LGKaeQ8smjB9xwhddq2uYQqkB47sr2bFlfZXZ/j6sezfmtkJYMl57hRoERBwRjT2nOEkC88dc/Y3WZGTQmdwCxCzm2zSPgLwwd4v5fpuRNEu+JQKSylRR+Qk18KXc0dFtdC+QA0ekdC9D19v/UHib4TkJdd2tP5kpQRdN8UQ3kWkRh2/U1X8Rz5y8avKmtIAVmrkMqOl11n2RV8uP8KnVz2U+Ye4HypST5v8EulI/F5mGgLkUBURMmePNs3Pn7H6f6Ifq43VU5jF5h34UpwilgZBFhiJMwx/HoRi3ksrgpC2X220k2XDw2X1uYEA1dYlvQkVxShwFHU2uLbkhdr3eLBklfFtyq57L8ZMjTy1DqwQQBJIe1AhMv78pTDY1CT/cZPJrFxShc92zWf4YpkQQaNP0QVDt+1J--yvoaPik0GL9WJM/O--up1WA52R3qkCKehYs3aDJg== \ No newline at end of file +YKfU5l6Ov/BSQ2f9dFDaYg6oB6vTubpbZ9SIp9d8XyHwu2aadiIM0HB/Z1OmKVcfm5kZY3pk9PmGNzSiZga7553+d7LzfRAY4fU0s2UWhn/2uXXAgjj3i0O9AaL7EesvpW9DSFZQb+JtmCQLEY+aTQTtO1YF34IpvyqAMtz75r5moKFQM0WzB48fv0bk0AI3ZhH9THWNvompAEKAE8ZTmNvhwyntt0AtB4cwyyBDybi6DRn4hYlxLzFcZRelAhR4GhfCbH8htd8n79eYZR2dp7bHP/svz3mFMUbhhRmIDiwqCyOovf/UAj7xF40MOVe2RBkycwE/UOpEc7/+YZFfE9y5ezoFQ3LlvnLIClsh2Ye4VXjvwEaGa5YNGqQiGrdk5w4zzVa1s0Kybq3q70b7+o5Wj1VIB2Gmoeo4FmxRubBtnxntMiic2lMAbdTRGniGmmSo9I2K+/KFYqtmIguTIdqsUcDgBockafmZrsKO0iDTmBnzef+Ws8u9K5P4lA==--1qH7QuK1ah68Kh2a--Qd/IItnduATpr/gMHFmHiA== \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index bdcd01d..27f96e6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -61,13 +61,13 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: "example.com" } # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. - # config.action_mailer.smtp_settings = { - # user_name: Rails.application.credentials.dig(:smtp, :user_name), - # password: Rails.application.credentials.dig(:smtp, :password), - # address: "smtp.example.com", - # port: 587, - # authentication: :plain - # } + config.action_mailer.smtp_settings = { + user_name: Rails.application.credentials.dig(:smtp, :user_name), + password: Rails.application.credentials.dig(:smtp, :password), + address: "smtpdm.aliyun.com", + port: 465, + authentication: :plain + } # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). diff --git a/test/integration/users_index_test.rb b/test/integration/users_index_test.rb index 363a64b..7c21c0e 100644 --- a/test/integration/users_index_test.rb +++ b/test/integration/users_index_test.rb @@ -12,10 +12,10 @@ class UsersIndexTest < ActionDispatch::IntegrationTest assert_template "users/index" assert_select "ul.pagination" - first_page_of_users = User.page(1) - first_page_of_users.first.toggle!(:activated) + first_page_of_users = User.where(activated: true).page(1) + # first_page_of_users.first.toggle!(:activated) first_page_of_users.each do |user| - # assert_not user.activated? + assert user.activated? assert_select "a[href=?]", user_path(user), text: user.name unless user == @admin assert_select "a[href=?]", user_path(user), text: "delete"