From 729b3398cece880389ac1dc49c9808ab1a7d204f Mon Sep 17 00:00:00 2001 From: ko Date: Fri, 2 Feb 2024 05:16:34 +0900 Subject: [PATCH 01/65] =?UTF-8?q?stripe=E3=81=AE=E5=8F=A4=E3=81=84?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E4=BD=BF=E3=82=8F?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/card.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/card.rb b/app/models/card.rb index 87f640dc65a..e3789998344 100644 --- a/app/models/card.rb +++ b/app/models/card.rb @@ -11,9 +11,7 @@ def create(user, card_token, idempotency_key = SecureRandom.uuid) end def update(customer_id, card_token) - customer = Stripe::Customer.retrieve(customer_id) - customer.source = card_token - customer.save + Stripe::Customer.update(customer_id, source: card_token) end def search(email:) From 700585d0de3f99e08a91066376361ca7626fa1f3 Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Wed, 7 Feb 2024 09:50:57 +0900 Subject: [PATCH 02/65] =?UTF-8?q?Markdown=E3=81=AE=E8=A8=98=E6=B3=95?= =?UTF-8?q?=E3=81=A7=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=82=A2=E3=82=A4?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= =?UTF-8?q?=E7=AE=87=E6=89=80=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6title?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hover時にユーザー名の文字列を表示するようにするため --- app/javascript/markdown-it-user-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/markdown-it-user-icon.js b/app/javascript/markdown-it-user-icon.js index cd245115bf6..b827ceeabe2 100644 --- a/app/javascript/markdown-it-user-icon.js +++ b/app/javascript/markdown-it-user-icon.js @@ -4,6 +4,6 @@ export default MarkdownItRegexp( /:@(?!mentor:)([a-zA-Z0-9_-]+):/, (match) => { - return `` + return `` } ) From 172eada29bc06492631cbf4fdfd58eb419b7cb14 Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Wed, 7 Feb 2024 11:53:49 +0900 Subject: [PATCH 03/65] =?UTF-8?q?title=E5=B1=9E=E6=80=A7=E3=82=92=E6=A4=9C?= =?UTF-8?q?=E8=A8=BC=E3=81=99=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/markdown_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/system/markdown_test.rb b/test/system/markdown_test.rb index 13f549fef30..f5d6fdf86e8 100644 --- a/test/system/markdown_test.rb +++ b/test/system/markdown_test.rb @@ -25,6 +25,7 @@ class MarkdownTest < ApplicationSystemTestCase assert_css '.a-long-text.is-md.js-markdown-view' assert_css "a[href='/users/mentormentaro']" + assert_includes find('.js-user-icon.a-user-emoji')['title'], '@mentormentaro' assert_includes find('.js-user-icon.a-user-emoji')['data-user'], 'mentormentaro' end From 84f623f72a5d44ac6f595899475e2ce39654b4ff Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Wed, 7 Feb 2024 16:58:31 +0900 Subject: [PATCH 04/65] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=A7?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=82=A2=E3=82=A4=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E7=AE=87?= =?UTF-8?q?=E6=89=80=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6title=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hover時にユーザー名の文字列を表示するようにするため --- app/javascript/markdown-it-container-speak.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/markdown-it-container-speak.js b/app/javascript/markdown-it-container-speak.js index 6814504e072..b0bd344f575 100644 --- a/app/javascript/markdown-it-container-speak.js +++ b/app/javascript/markdown-it-container-speak.js @@ -11,7 +11,7 @@ export default (md) => { return `
From c93cd46482f6a66c4b5e9c7a07395399220ec93d Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Wed, 7 Feb 2024 17:01:15 +0900 Subject: [PATCH 05/65] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E7=94=A8?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/markdown_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/system/markdown_test.rb b/test/system/markdown_test.rb index f5d6fdf86e8..ad01101fea4 100644 --- a/test/system/markdown_test.rb +++ b/test/system/markdown_test.rb @@ -13,6 +13,7 @@ class MarkdownTest < ApplicationSystemTestCase assert_css '.a-long-text.is-md.js-markdown-view' assert_css '.speak' assert_css "a[href='/users/mentormentaro']" + assert_includes find('.js-user-icon.a-user-emoji')['title'], '@mentormentaro' assert_includes find('.js-user-icon.a-user-emoji')['data-user'], 'mentormentaro' end From f38e7982148fabbe4b23d5b740336eae6a35abf2 Mon Sep 17 00:00:00 2001 From: a-terumoto-gs Date: Thu, 8 Feb 2024 10:12:54 +0900 Subject: [PATCH 06/65] =?UTF-8?q?=E3=80=8C=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E5=88=87=E3=82=8C=E3=82=92=E8=AA=BF=E3=81=B9=E3=81=A6=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=82=92=E5=87=BA=E3=81=99=E3=80=8D=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=AE=E3=80=81=E3=83=A1=E3=83=BC=E3=83=AB=E5=AE=9B?= =?UTF-8?q?=E5=85=88=E3=82=92lokka=E3=81=AB=E6=9B=B4=E6=96=B0=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/check_url_mailer.rb | 2 +- test/mailers/check_url_mailer_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/mailers/check_url_mailer.rb b/app/mailers/check_url_mailer.rb index ba6b908c57a..8c948326937 100644 --- a/app/mailers/check_url_mailer.rb +++ b/app/mailers/check_url_mailer.rb @@ -5,6 +5,6 @@ def notify_error_url(page_error_url, practice_error_url) @page_error_url = page_error_url @practice_error_url = practice_error_url @number_of_error_url = page_error_url.size + practice_error_url.size - mail to: 'info@fjord.jp', subject: '[FBC Admin] リンク切れ報告' + mail to: 'info@lokka.jp', subject: '[FBC Admin] リンク切れ報告' end end diff --git a/test/mailers/check_url_mailer_test.rb b/test/mailers/check_url_mailer_test.rb index 6a289da6354..3faa7591a08 100644 --- a/test/mailers/check_url_mailer_test.rb +++ b/test/mailers/check_url_mailer_test.rb @@ -14,7 +14,7 @@ class CheckUrlMailerTest < ActionMailer::TestCase mail = CheckUrlMailer.notify_error_url(page_error_url, practice_error_url).deliver_now assert_not ActionMailer::Base.deliveries.empty? assert_equal '[FBC Admin] リンク切れ報告', mail.subject - assert_equal ['info@fjord.jp'], mail.to + assert_equal ['info@lokka.jp'], mail.to assert_equal ['noreply@bootcamp.fjord.jp'], mail.from assert_match(/リンク切れがありました。/, mail.body.to_s) end From fde81952377d44fbda89d78d5fd79052a7ec1324 Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Thu, 8 Feb 2024 14:16:03 +0900 Subject: [PATCH 07/65] =?UTF-8?q?=E5=AD=A6=E7=BF=92=E9=96=8B=E5=A7=8B?= =?UTF-8?q?=E6=99=82=E9=96=93=E3=81=A8=E7=B5=82=E4=BA=86=E6=99=82=E9=96=93?= =?UTF-8?q?=E3=81=AE=E6=AF=94=E8=BC=83=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6?= =?UTF-8?q?to=5Fdate=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E7=94=A8?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=93=E3=81=A8=E3=81=A7=E3=80=81TimeWithZ?= =?UTF-8?q?one=E3=81=AE=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=8B=E3=82=89Date=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=B8=E5=A4=89=E6=8F=9B=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dayのみで比較すると、月を跨いだ際に(翌日)と表示されなかったため --- app/views/reports/_learning_times.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reports/_learning_times.html.slim b/app/views/reports/_learning_times.html.slim index 894fba8e7db..306771f4699 100644 --- a/app/views/reports/_learning_times.html.slim +++ b/app/views/reports/_learning_times.html.slim @@ -10,4 +10,4 @@ ul.learning-times__items - @report.learning_times.each do |learning_time| li.learning-times__item - | #{l learning_time.started_at, format: :time_only} 〜 #{'(翌日)' if learning_time.started_at.day < learning_time.finished_at.day}#{l learning_time.finished_at, format: :time_only} + | #{l learning_time.started_at, format: :time_only} 〜 #{'(翌日)' if learning_time.started_at.to_date < learning_time.finished_at.to_date}#{l learning_time.finished_at, format: :time_only} From 6a1fdec6d2a3e02e029f404b44693870cd4a2dd7 Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Thu, 8 Feb 2024 14:17:02 +0900 Subject: [PATCH 08/65] =?UTF-8?q?=E6=9C=88=E3=82=92=E8=B7=A8=E3=81=84?= =?UTF-8?q?=E3=81=A0=E6=97=A5=E5=A0=B1=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/reports_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 4091521e40e..1d4659b1661 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -277,6 +277,23 @@ class ReportsTest < ApplicationSystemTestCase assert_text '00:30 〜 02:30' end + test 'learning times when carrying over next month' do + visit_with_auth '/reports/new', 'komagata' + fill_in 'report_title', with: 'テスト日報' + fill_in 'report_description', with: '学習時間が月を跨いでいるパターン' + fill_in 'report_reported_on', with: Date.new(2024, 1, 31) + + all('.learning-time')[0].all('.learning-time__started-at select')[0].select('22') + all('.learning-time')[0].all('.learning-time__started-at select')[1].select('00') + all('.learning-time')[0].all('.learning-time__finished-at select')[0].select('00') + all('.learning-time')[0].all('.learning-time__finished-at select')[1].select('00') + + click_button '提出' + + assert_text "2時間\n" + assert_text '22:00 〜 (翌日)00:00' + end + test 'learning times order' do visit_with_auth '/reports/new', 'komagata' fill_in 'report_title', with: 'テスト日報' From 1a25688b8b93c4a7067ad5c1b7ad84c052e6926b Mon Sep 17 00:00:00 2001 From: junohm410 Date: Fri, 9 Feb 2024 15:25:19 +0900 Subject: [PATCH 09/65] =?UTF-8?q?develop/test=E7=92=B0=E5=A2=83=E3=81=AB?= =?UTF-8?q?=E3=81=8A=E3=81=84=E3=81=A6=E3=82=82Disk=E3=82=B5=E3=83=BC?= =?UTF-8?q?=E3=83=93=E3=82=B9=E3=81=B8=E3=81=AE=E3=83=91=E3=83=96=E3=83=AA?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=82=92?= =?UTF-8?q?=E8=A8=B1=E5=8F=AF=E3=81=97=E3=80=81=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=AEurl=E3=82=92=E7=94=9F=E6=88=90=E3=81=99?= =?UTF-8?q?=E3=82=8B=E9=9A=9B=E3=81=AE=E5=8B=95=E3=81=8D=E3=82=92=E6=9C=AC?= =?UTF-8?q?=E7=95=AA=E7=92=B0=E5=A2=83=E3=81=A8=E5=90=88=E3=82=8F=E3=81=9B?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/storage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/storage.yml b/config/storage.yml index d323020cb11..2d8a90ff91f 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -1,10 +1,12 @@ test: service: Disk root: <%= Rails.root.join("tmp/storage") %> + public: true local: service: Disk root: <%= Rails.root.join("storage") %> + public: true google: service: GCS From 627b2fec0cf5b4392214a1de7853ee711942a9cb Mon Sep 17 00:00:00 2001 From: naokinaokiboo Date: Fri, 2 Feb 2024 22:57:45 +0900 Subject: [PATCH 10/65] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E4=B8=80=E8=A6=A7=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E5=90=84?= =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E6=95=B0=E3=82=92?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/user-activity-counts.vue | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/app/javascript/components/user-activity-counts.vue b/app/javascript/components/user-activity-counts.vue index e7e384104a1..d857bcb9aa3 100644 --- a/app/javascript/components/user-activity-counts.vue +++ b/app/javascript/components/user-activity-counts.vue @@ -7,35 +7,50 @@ | 日報 dd.card-counts__item-value( :class='user.report_count == 0 ? "is-empty" : ""') - | {{ user.report_count }} + span(v-if='user.report_count == 0') + | {{ user.report_count }} + a.a-text-link(v-else)(:href='`${user.url}/reports`') + | {{ user.report_count }} .card-counts__item .card-counts__item-inner dt.card-counts__item-label | 提出物 dd.card-counts__item-value( :class='user.product_count == 0 ? "is-empty" : ""') - | {{ user.product_count }} + span(v-if='user.product_count == 0') + | {{ user.product_count }} + a.a-text-link(v-else)(:href='`${user.url}/products`') + | {{ user.product_count }} .card-counts__item .card-counts__item-inner dt.card-counts__item-label | コメント dd.card-counts__item-value( :class='user.comment_count == 0 ? "is-empty" : ""') - | {{ user.comment_count }} + span(v-if='user.comment_count == 0') + | {{ user.comment_count }} + a.a-text-link(v-else)(:href='`${user.url}/comments`') + | {{ user.comment_count }} .card-counts__item .card-counts__item-inner dt.card-counts__item-label | 質問 dd.card-counts__item-value( :class='user.question_count == 0 ? "is-empty" : ""') - | {{ user.question_count }} + span(v-if='user.question_count == 0') + | {{ user.question_count }} + a.a-text-link(v-else)(:href='`${user.url}/questions`') + | {{ user.question_count }} .card-counts__item .card-counts__item-inner dt.card-counts__item-label | 回答 dd.card-counts__item-value( :class='user.answer_count == 0 ? "is-empty" : ""') - | {{ user.answer_count }} + span(v-if='user.answer_count == 0') + | {{ user.answer_count }} + a.a-text-link(v-else)(:href='`${user.url}/answers`') + | {{ user.answer_count }} diff --git a/app/javascript/components/user-activity-counts.vue b/app/javascript/components/user-activity-counts.vue index d857bcb9aa3..ea3a1264806 100644 --- a/app/javascript/components/user-activity-counts.vue +++ b/app/javascript/components/user-activity-counts.vue @@ -1,59 +1,33 @@ diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index ac482c62041..6664461a85a 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,6 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) + = render "share_buttons", article: @article.id - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) From 9dab9833c63659f656055ab33f61d507f1f09fdd Mon Sep 17 00:00:00 2001 From: 88-99 Date: Wed, 13 Dec 2023 22:15:05 +0900 Subject: [PATCH 43/65] =?UTF-8?q?Facebook=E3=81=AE=E3=82=B7=E3=82=A7?= =?UTF-8?q?=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E8=A8=AD=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/_share_buttons.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/articles/_share_buttons.html.erb b/app/views/articles/_share_buttons.html.erb index c41e1144ef7..45ec95f8443 100644 --- a/app/views/articles/_share_buttons.html.erb +++ b/app/views/articles/_share_buttons.html.erb @@ -1,3 +1,9 @@ +
+ + + このエントリーをはてなブックマークに追加 From 66353b556cd0bd516c0d720941c95d520161f3ce Mon Sep 17 00:00:00 2001 From: 88-99 Date: Wed, 13 Dec 2023 23:04:15 +0900 Subject: [PATCH 44/65] =?UTF-8?q?X=E3=81=AE=E3=82=B7=E3=82=A7=E3=82=A2?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E8=A8=AD=E7=BD=AE=E3=80=82?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=95=B4=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/_share_buttons.html.erb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/views/articles/_share_buttons.html.erb b/app/views/articles/_share_buttons.html.erb index 45ec95f8443..75381c6dfa0 100644 --- a/app/views/articles/_share_buttons.html.erb +++ b/app/views/articles/_share_buttons.html.erb @@ -1,10 +1,23 @@ + +X +
- + このエントリーをはてなブックマークに追加 From 28982fbc5ca95d6adf69b098222f8749642660ce Mon Sep 17 00:00:00 2001 From: 88-99 Date: Thu, 14 Dec 2023 00:30:07 +0900 Subject: [PATCH 45/65] =?UTF-8?q?=E3=83=96=E3=83=AD=E3=82=B0=E8=A8=98?= =?UTF-8?q?=E4=BA=8B=E3=81=AE=E4=B8=8B=E9=83=A8=E3=81=AB=E3=82=82=E3=82=B7?= =?UTF-8?q?=E3=82=A7=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E8=A8=AD?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/show.html.slim | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index 6664461a85a..2934eb484a5 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -54,6 +54,7 @@ ruby: .article__body .js-markdown-view.a-long-text.is-md = @article.body + = render "share_buttons", article: @article.id - if admin_or_mentor_login? hr.a-border .card-footer From 9951f3cf34f1fe6185567e399b48cebf2915b6e4 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 17 Dec 2023 18:20:02 +0900 Subject: [PATCH 46/65] =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=ABarticle.id=E3=82=92=E6=B8=A1?= =?UTF-8?q?=E3=81=99=E3=81=AE=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=81?= =?UTF-8?q?article=E3=82=92=E6=B8=A1=E3=81=97=E3=81=A6=E3=83=86=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E5=81=B4=E3=81=A7article.i?= =?UTF-8?q?d=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E5=80=A4=E3=82=92?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/_share_buttons.html.erb | 8 ++++---- app/views/articles/show.html.slim | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/articles/_share_buttons.html.erb b/app/views/articles/_share_buttons.html.erb index 75381c6dfa0..9fe90328444 100644 --- a/app/views/articles/_share_buttons.html.erb +++ b/app/views/articles/_share_buttons.html.erb @@ -1,5 +1,5 @@ @@ -7,15 +7,15 @@ X
-
+ このエントリーをはてなブックマークに追加 diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index 2934eb484a5..d911d61bc4d 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,7 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) - = render "share_buttons", article: @article.id + = render "share_buttons", article: @article - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) @@ -54,7 +54,7 @@ ruby: .article__body .js-markdown-view.a-long-text.is-md = @article.body - = render "share_buttons", article: @article.id + = render "share_buttons", article: @article - if admin_or_mentor_login? hr.a-border .card-footer From f2cccd1e428bffbf2d4277b5964f57e4ca0a8097 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 17 Dec 2023 20:19:53 +0900 Subject: [PATCH 47/65] =?UTF-8?q?RuboCop=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/show.html.slim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index d911d61bc4d..fe533175762 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,7 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) - = render "share_buttons", article: @article + = render 'share_buttons', article: @article - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) @@ -54,7 +54,7 @@ ruby: .article__body .js-markdown-view.a-long-text.is-md = @article.body - = render "share_buttons", article: @article + = render 'share_buttons', article: @article - if admin_or_mentor_login? hr.a-border .card-footer From a3d3b0b6127ec18848a343bdb26550b3ceed9c69 Mon Sep 17 00:00:00 2001 From: machida Date: Fri, 5 Jan 2024 16:17:07 +0900 Subject: [PATCH 48/65] =?UTF-8?q?=E3=82=B7=E3=82=A7=E3=82=A2=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=81=AB=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=85=A5=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/stylesheets/welcome.sass | 1 + .../welcome/articles/_share-buttons.sass | 53 +++++++++++++++++++ .../articles/_share_button_facebook.html.erb | 8 +++ .../articles/_share_button_hatena.html.erb | 7 +++ app/views/articles/_share_button_x.html.erb | 8 +++ app/views/articles/_share_buttons.html.erb | 23 -------- app/views/articles/_share_buttons.html.slim | 8 +++ app/views/articles/show.html.slim | 2 +- 8 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 app/javascript/stylesheets/welcome/articles/_share-buttons.sass create mode 100644 app/views/articles/_share_button_facebook.html.erb create mode 100644 app/views/articles/_share_button_hatena.html.erb create mode 100644 app/views/articles/_share_button_x.html.erb delete mode 100644 app/views/articles/_share_buttons.html.erb create mode 100644 app/views/articles/_share_buttons.html.slim diff --git a/app/javascript/stylesheets/welcome.sass b/app/javascript/stylesheets/welcome.sass index 8c7bbb1deb8..5a7cf97e69a 100644 --- a/app/javascript/stylesheets/welcome.sass +++ b/app/javascript/stylesheets/welcome.sass @@ -7,6 +7,7 @@ @import welcome/articles/article @import welcome/articles/articles-item @import welcome/articles/bootcamp-ad +@import welcome/articles/share-buttons @import welcome/auth-form2/auth-form diff --git a/app/javascript/stylesheets/welcome/articles/_share-buttons.sass b/app/javascript/stylesheets/welcome/articles/_share-buttons.sass new file mode 100644 index 00000000000..10bfaad62a1 --- /dev/null +++ b/app/javascript/stylesheets/welcome/articles/_share-buttons.sass @@ -0,0 +1,53 @@ +.share-buttons + margin-top: .75rem + +.share-buttons__items + display: flex + gap: .5rem + @media (max-width: 20em) + gap: .25rem + +.share-buttons__item + @media (max-width: 20em) + &.is-x + flex: 1 + + +.x-share-button + width: 5.5rem + height: 2.5rem + background-color: white + +flex-link + flex-direction: column + border-radius: .25rem + align-items: center + justify-content: center + +text-block(.6875rem 1, 700) + color: var(--reversal-text) + border: solid 1px black + overflow: hidden + i + font-size: .875rem + color: black + flex: 1 + width: 100% + display: flex + align-items: center + justify-content: center + transition: all .2s ease-out + span + background-color: var(--default-text) + display: flex + width: 100% + height: 1.25rem + align-items: center + justify-content: center + transition: all .2s ease-out + padding-top: 1px + &:hover + i + background-color: var(--background-tint) + span + background-color: black + @media (max-width: 20em) + width: 100% diff --git a/app/views/articles/_share_button_facebook.html.erb b/app/views/articles/_share_button_facebook.html.erb new file mode 100644 index 00000000000..d492e338d7d --- /dev/null +++ b/app/views/articles/_share_button_facebook.html.erb @@ -0,0 +1,8 @@ +
+ +
diff --git a/app/views/articles/_share_button_hatena.html.erb b/app/views/articles/_share_button_hatena.html.erb new file mode 100644 index 00000000000..93a91d28ab3 --- /dev/null +++ b/app/views/articles/_share_button_hatena.html.erb @@ -0,0 +1,7 @@ + + このエントリーをはてなブックマークに追加 + + diff --git a/app/views/articles/_share_button_x.html.erb b/app/views/articles/_share_button_x.html.erb new file mode 100644 index 00000000000..a56c8745c09 --- /dev/null +++ b/app/views/articles/_share_button_x.html.erb @@ -0,0 +1,8 @@ + + + Postする + diff --git a/app/views/articles/_share_buttons.html.erb b/app/views/articles/_share_buttons.html.erb deleted file mode 100644 index 9fe90328444..00000000000 --- a/app/views/articles/_share_buttons.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - -X - -
- - - - - このエントリーをはてなブックマークに追加 - - diff --git a/app/views/articles/_share_buttons.html.slim b/app/views/articles/_share_buttons.html.slim new file mode 100644 index 00000000000..dc82491a03e --- /dev/null +++ b/app/views/articles/_share_buttons.html.slim @@ -0,0 +1,8 @@ +.share-buttons + ul.share-buttons__items + li.share-buttons__item.is-x + = render 'share_button_x', article: article + li.share-buttons__item + = render 'share_button_facebook', article: article + li.share-buttons__item + = render 'share_button_hatena', article: article diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index fe533175762..1bfb4fa7a30 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,7 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) - = render 'share_buttons', article: @article + = render "share_buttons", article: @article - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) From 34a8fef7a19d6b919d671c8cc402076e0b61495a Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 7 Jan 2024 14:53:30 +0900 Subject: [PATCH 49/65] =?UTF-8?q?double=20quotes=E3=82=92single=20quotes?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index 1bfb4fa7a30..63da72600da 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,7 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) - = render "share_buttons", article: @article + = render 'share_buttons', article: @article - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) From e317de74c0d80023c7cb241ad2209c79ed2ae468 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 7 Jan 2024 16:23:29 +0900 Subject: [PATCH 50/65] =?UTF-8?q?share=5Fbuttons=E3=81=AB=EF=BC=A0article.?= =?UTF-8?q?id=E3=82=92=E6=B8=A1=E3=81=99=E3=82=88=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=82=E3=83=96=E3=83=AD=E3=82=B0=E5=80=8B=E5=88=A5?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AEURL=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=8F=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=82=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index 63da72600da..f8c7b4af46b 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -46,7 +46,7 @@ ruby: = l(@article.created_at) - else = l(@article.published_at) - = render 'share_buttons', article: @article + = render 'share_buttons', article: @article.id - if @article.thumbnail.attached? && @article.prepared_thumbnail? = image_tag @article.prepared_thumbnail_url, class: 'article__image' - elsif !thumbnail_blank?(@article) From 619fd65547cc259be22f32e37db71399fdf8cb16 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 7 Jan 2024 20:28:02 +0900 Subject: [PATCH 51/65] =?UTF-8?q?X=E3=81=AE=E3=82=B7=E3=82=A7=E3=82=A2?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index 43c9c72a361..3108c4c5a9c 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -373,4 +373,13 @@ class ArticlesTest < ApplicationSystemTestCase click_on '更新する' assert_text '2021年12月24日(金) 23:59' end + + test 'share button X' do + visit "/articles/#{@article.id}" + + new_window = window_opened_by { click_on 'Postする', match: :first } + within_window new_window do + assert_current_path "https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/#{@article.id}&hashtags=fjordbootcamp" + end + end end From 7226a72da5203ba50f2b61b6f9e124cc303ef9ed Mon Sep 17 00:00:00 2001 From: 88-99 Date: Sun, 7 Jan 2024 20:30:51 +0900 Subject: [PATCH 52/65] =?UTF-8?q?=E3=81=AF=E3=81=A6=E3=81=B6=E3=81=AE?= =?UTF-8?q?=E3=82=B7=E3=82=A7=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index 3108c4c5a9c..3067b4ae889 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -382,4 +382,13 @@ class ArticlesTest < ApplicationSystemTestCase assert_current_path "https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/#{@article.id}&hashtags=fjordbootcamp" end end + + test 'share button Hatena' do + visit "/articles/#{@article.id}" + + new_window = window_opened_by { first('.hatena-bookmark-button-frame').click } + within_window new_window do + assert_current_path "https://b.hatena.ne.jp/site/bootcamp.fjord.jp/#bookmark_url=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F#{@article.id}" + end + end end From 5de83b4e7413f886494f8c61af591187c2a42804 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Mon, 29 Jan 2024 22:21:23 +0900 Subject: [PATCH 53/65] =?UTF-8?q?Facebook=E3=81=AE=E3=82=B7=E3=82=A7?= =?UTF-8?q?=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index 3067b4ae889..88f35c7ad6e 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -383,6 +383,27 @@ class ArticlesTest < ApplicationSystemTestCase end end + test 'share button Facebook' do + visit "/articles/#{@article.id}" + + new_window = window_opened_by do + within find('.fb-share-button', match: :first) do + within_frame do + find('#icon-button').click + end + end + end + + url = '/login.php?skip_api_login=1&api_key=966242223397117&signed_next=1'\ + '&next=https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php%3Fkid_directed_site%3D0%26sdk%3Djoey'\ + "%26u%3Dhttps%253A%252F%252Fbootcamp.fjord.jp%252Farticles%252F#{@article.id}%26display%3Dpopup%26ref%3Dplugin%26src%3Dshare_button"\ + '&cancel_url=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Fclose_window%2F%3Fapp_id%3D966242223397117%26connect%3D0%23_%3D_'\ + '&display=popup&locale=ja_JP&kid_directed_site=0' + within_window new_window do + assert_current_path url + end + end + test 'share button Hatena' do visit "/articles/#{@article.id}" From cecdcb428f9e99bdbdc2b06eb2f767d02f3d7ae4 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Tue, 30 Jan 2024 19:04:57 +0900 Subject: [PATCH 54/65] =?UTF-8?q?X=E3=81=AE=E3=82=B7=E3=82=A7=E3=82=A2?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index 88f35c7ad6e..44ae7c6e5d0 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -377,10 +377,7 @@ class ArticlesTest < ApplicationSystemTestCase test 'share button X' do visit "/articles/#{@article.id}" - new_window = window_opened_by { click_on 'Postする', match: :first } - within_window new_window do - assert_current_path "https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/#{@article.id}&hashtags=fjordbootcamp" - end + assert_selector 'a.x-share-button[href^="https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/"]', text: 'Postする' end test 'share button Facebook' do From cfd3e1a67e4bd8c8ffa90ac31a45eab9e11bcf11 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Tue, 30 Jan 2024 19:09:55 +0900 Subject: [PATCH 55/65] =?UTF-8?q?=E3=81=AF=E3=81=A6=E3=81=B6=E3=81=AE?= =?UTF-8?q?=E3=82=B7=E3=82=A7=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index 44ae7c6e5d0..d3d87fee2b8 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -404,9 +404,8 @@ class ArticlesTest < ApplicationSystemTestCase test 'share button Hatena' do visit "/articles/#{@article.id}" - new_window = window_opened_by { first('.hatena-bookmark-button-frame').click } - within_window new_window do - assert_current_path "https://b.hatena.ne.jp/site/bootcamp.fjord.jp/#bookmark_url=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F#{@article.id}" + within_frame(find('.hatena-bookmark-button-frame', match: :first)) do + assert_selector "a[href='https://b.hatena.ne.jp/entry/s/bootcamp.fjord.jp/articles/#{@article.id}#bbutton']" end end end From c8aea07bc30fa9fb5cd7cbe55eefe8f2903d2c13 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Tue, 30 Jan 2024 20:03:49 +0900 Subject: [PATCH 56/65] =?UTF-8?q?Facebook=E3=81=AE=E3=82=B7=E3=82=A7?= =?UTF-8?q?=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index d3d87fee2b8..b227014f641 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -383,22 +383,15 @@ class ArticlesTest < ApplicationSystemTestCase test 'share button Facebook' do visit "/articles/#{@article.id}" - new_window = window_opened_by do - within find('.fb-share-button', match: :first) do - within_frame do - find('#icon-button').click - end + within find('.fb-share-button', match: :first) do + within_frame do + assert_selector "a[ + href='/sharer/sharer.php?kid_directed_site=0&sdk=joey&" \ + "u=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F#{@article.id}&display=popup&" \ + "ref=plugin&src=share_button' + ]" end end - - url = '/login.php?skip_api_login=1&api_key=966242223397117&signed_next=1'\ - '&next=https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php%3Fkid_directed_site%3D0%26sdk%3Djoey'\ - "%26u%3Dhttps%253A%252F%252Fbootcamp.fjord.jp%252Farticles%252F#{@article.id}%26display%3Dpopup%26ref%3Dplugin%26src%3Dshare_button"\ - '&cancel_url=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Fclose_window%2F%3Fapp_id%3D966242223397117%26connect%3D0%23_%3D_'\ - '&display=popup&locale=ja_JP&kid_directed_site=0' - within_window new_window do - assert_current_path url - end end test 'share button Hatena' do From 0f9498242aa01ac67216e71f253c99b91874c9a6 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Thu, 1 Feb 2024 23:48:45 +0900 Subject: [PATCH 57/65] =?UTF-8?q?=E4=B8=8B=E5=81=B4=E3=81=AE=E3=82=B7?= =?UTF-8?q?=E3=82=A7=E3=82=A2=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=A7=EF=BC=A0?= =?UTF-8?q?article.id=E3=82=92=E6=B8=A1=E3=81=99=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/articles/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/articles/show.html.slim b/app/views/articles/show.html.slim index f8c7b4af46b..a1d18675d1e 100644 --- a/app/views/articles/show.html.slim +++ b/app/views/articles/show.html.slim @@ -54,7 +54,7 @@ ruby: .article__body .js-markdown-view.a-long-text.is-md = @article.body - = render 'share_buttons', article: @article + = render 'share_buttons', article: @article.id - if admin_or_mentor_login? hr.a-border .card-footer From 901571fe2eea3162de3f218ea13f1536959cab98 Mon Sep 17 00:00:00 2001 From: 88-99 Date: Wed, 7 Feb 2024 13:06:23 +0900 Subject: [PATCH 58/65] =?UTF-8?q?URL=E3=82=92=E3=82=B9=E3=83=AA=E3=83=A0?= =?UTF-8?q?=E5=8C=96=E3=80=82=E3=82=B7=E3=82=A7=E3=82=A2=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=83=96=E3=83=AD=E3=82=B0=E8=A8=98=E4=BA=8B=E3=82=92=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/articles_test.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/system/articles_test.rb b/test/system/articles_test.rb index b227014f641..2d269bd05a7 100644 --- a/test/system/articles_test.rb +++ b/test/system/articles_test.rb @@ -385,11 +385,7 @@ class ArticlesTest < ApplicationSystemTestCase within find('.fb-share-button', match: :first) do within_frame do - assert_selector "a[ - href='/sharer/sharer.php?kid_directed_site=0&sdk=joey&" \ - "u=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F#{@article.id}&display=popup&" \ - "ref=plugin&src=share_button' - ]" + assert_selector "a[href*='u=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F#{@article.id}']" end end end From 37cc341c5c7c3e6c3de06103119da17da9bfe302 Mon Sep 17 00:00:00 2001 From: a-kuroki-gs Date: Mon, 19 Feb 2024 14:11:59 +0900 Subject: [PATCH 59/65] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE?= =?UTF-8?q?=E4=B8=80=E9=83=A8=E3=82=92DRY=E3=81=AA=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/markdown_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/system/markdown_test.rb b/test/system/markdown_test.rb index ad01101fea4..4336c54276b 100644 --- a/test/system/markdown_test.rb +++ b/test/system/markdown_test.rb @@ -13,8 +13,9 @@ class MarkdownTest < ApplicationSystemTestCase assert_css '.a-long-text.is-md.js-markdown-view' assert_css '.speak' assert_css "a[href='/users/mentormentaro']" - assert_includes find('.js-user-icon.a-user-emoji')['title'], '@mentormentaro' - assert_includes find('.js-user-icon.a-user-emoji')['data-user'], 'mentormentaro' + emoji = find('.js-user-icon.a-user-emoji') + assert_includes emoji['title'], '@mentormentaro' + assert_includes emoji['data-user'], 'mentormentaro' end test 'user profile image markdown test' do @@ -26,8 +27,9 @@ class MarkdownTest < ApplicationSystemTestCase assert_css '.a-long-text.is-md.js-markdown-view' assert_css "a[href='/users/mentormentaro']" - assert_includes find('.js-user-icon.a-user-emoji')['title'], '@mentormentaro' - assert_includes find('.js-user-icon.a-user-emoji')['data-user'], 'mentormentaro' + emoji = find('.js-user-icon.a-user-emoji') + assert_includes emoji['title'], '@mentormentaro' + assert_includes emoji['data-user'], 'mentormentaro' end def cmd_ctrl From 1f8b21ffa20f1d55aab54b45f671850200e6e0cf Mon Sep 17 00:00:00 2001 From: a-terumoto-gs Date: Mon, 19 Feb 2024 15:22:33 +0900 Subject: [PATCH 60/65] =?UTF-8?q?#=E3=81=AE=E3=81=82=E3=81=A8=E3=81=AB1?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/slim_lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/slim_lint.yml b/config/slim_lint.yml index 60fd1dbb037..b05b6c15b66 100644 --- a/config/slim_lint.yml +++ b/config/slim_lint.yml @@ -25,11 +25,11 @@ linters: - Layout/MultilineOperationIndentation - Layout/ParameterAlignment - Layout/TrailingEmptyLines - - Lint/Void #除外検討したが見送り - - Metrics/BlockLength #除外検討したが見送り + - Lint/Void # 除外検討したが見送り + - Metrics/BlockLength # 除外検討したが見送り - Metrics/BlockNesting - Naming/FileName - - Style/FrozenStringLiteralComment #除外検討したが見送り + - Style/FrozenStringLiteralComment # 除外検討したが見送り - Style/IdenticalConditionalBranches - Style/IfUnlessModifier - Style/Next From a8f83e57571b889147811603a4b7a28cc50a1e4c Mon Sep 17 00:00:00 2001 From: masyuko0222 Date: Mon, 5 Feb 2024 21:00:29 +0900 Subject: [PATCH 61/65] =?UTF-8?q?rubocop=E3=81=AE=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=8B=E3=82=89=E9=99=A4=E5=A4=96=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E3=80=81=E9=81=A9=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rubocop_todo.yml | 12 -- test/deliveries/activity_delivery_test.rb | 16 +-- test/mailers/activity_mailer_test.rb | 136 +++++++++--------- test/mailers/notification_mailer_test.rb | 2 +- .../previews/activity_mailer_preview.rb | 54 +++---- .../previews/notification_mailer_preview.rb | 14 +- test/models/answer_test.rb | 2 +- test/models/bookmark_test.rb | 20 +-- test/models/category_test.rb | 2 +- test/models/discord/times_channel_test.rb | 2 +- test/models/event_test.rb | 2 +- 11 files changed, 125 insertions(+), 137 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3bae12090f3..2f751e026e3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -11,15 +11,3 @@ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys # SupportedShorthandSyntax: always, never, either, consistent -Style/HashSyntax: - Exclude: - - 'test/deliveries/activity_delivery_test.rb' - - 'test/mailers/activity_mailer_test.rb' - - 'test/mailers/notification_mailer_test.rb' - - 'test/mailers/previews/activity_mailer_preview.rb' - - 'test/mailers/previews/notification_mailer_preview.rb' - - 'test/models/answer_test.rb' - - 'test/models/bookmark_test.rb' - - 'test/models/category_test.rb' - - 'test/models/discord/times_channel_test.rb' - - 'test/models/event_test.rb' diff --git a/test/deliveries/activity_delivery_test.rb b/test/deliveries/activity_delivery_test.rb index 6f22e15bbe1..8c634c6f100 100644 --- a/test/deliveries/activity_delivery_test.rb +++ b/test/deliveries/activity_delivery_test.rb @@ -42,7 +42,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:checked)' do check = checks(:procuct2_check_komagata) params = { - check: check, + check:, receiver: check.receiver } @@ -107,7 +107,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:submitted)' do product = products(:product6) params = { - product: product, + product:, receiver: users(:mentormentaro) } @@ -204,7 +204,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:assigned_as_checker)' do product = products(:product64) params = { - product: product, + product:, receiver: User.find(product.checker_id) } @@ -251,7 +251,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:first_report)' do report = reports(:report10) params = { - report: report, + report:, receiver: users(:komagata) } @@ -298,7 +298,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:update_regular_event)' do regular_event = regular_events(:regular_event1) params = { - regular_event: regular_event, + regular_event:, receiver: users(:komagata) } @@ -348,7 +348,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:chose_correct_answer)' do answer = answers(:answer1) params = { - answer: answer, + answer:, receiver: answer.user } @@ -372,7 +372,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase test '.notify(:no_correct_answer)' do question = questions(:question1) params = { - question: question, + question:, receiver: question.user } @@ -421,7 +421,7 @@ class ActivityDeliveryTest < ActiveSupport::TestCase commentable_path = Rails.application.routes.url_helpers.polymorphic_path(comment.commentable) params = { - comment: comment, + comment:, receiver: comment.receiver, message: "相談部屋で#{comment.sender.login_name}さんからコメントがありました。", link: "#{commentable_path}#latest-comment" diff --git a/test/mailers/activity_mailer_test.rb b/test/mailers/activity_mailer_test.rb index 6256aab619e..e3f55145ceb 100644 --- a/test/mailers/activity_mailer_test.rb +++ b/test/mailers/activity_mailer_test.rb @@ -99,7 +99,7 @@ class ActivityMailerTest < ActionMailer::TestCase test 'came_answer' do answer = answers(:answer3) - ActivityMailer.came_answer(answer: answer).deliver_now + ActivityMailer.came_answer(answer:).deliver_now assert_not ActionMailer::Base.deliveries.empty? email = ActionMailer::Base.deliveries.last @@ -112,7 +112,7 @@ class ActivityMailerTest < ActionMailer::TestCase test 'came_answer with params' do answer = answers(:answer3) - mailer = ActivityMailer.with(answer: answer).came_answer + mailer = ActivityMailer.with(answer:).came_answer perform_enqueued_jobs do mailer.deliver_later @@ -153,7 +153,7 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:sotugyou) ActivityMailer.post_announcement( announcement: announce, - receiver: receiver + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -170,7 +170,7 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:sotugyou) mailer = ActivityMailer.with( announcement: announce, - receiver: receiver + receiver: ).post_announcement perform_enqueued_jobs do @@ -193,28 +193,28 @@ class ActivityMailerTest < ActionMailer::TestCase receiver.update_columns(mail_notification: false, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.post_announcement( announcement: announce, - receiver: receiver + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: false, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.post_announcement( announcement: announce, - receiver: receiver + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: true, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.post_announcement( announcement: announce, - receiver: receiver + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: true, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.post_announcement( announcement: announce, - receiver: receiver + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? end @@ -227,7 +227,7 @@ class ActivityMailerTest < ActionMailer::TestCase ActivityMailer.came_question( sender: user, receiver: mentor, - question: question + question: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -247,7 +247,7 @@ class ActivityMailerTest < ActionMailer::TestCase mailer = ActivityMailer.with( sender: user, receiver: mentor, - question: question + question: ).came_question perform_enqueued_jobs do @@ -267,7 +267,7 @@ class ActivityMailerTest < ActionMailer::TestCase mentionable = comments(:comment9) mentioned = notifications(:notification_mentioned) ActivityMailer.mentioned( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).deliver_now @@ -284,7 +284,7 @@ class ActivityMailerTest < ActionMailer::TestCase mentionable = comments(:comment9) mentioned = notifications(:notification_mentioned) mailer = ActivityMailer.with( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).mentioned @@ -307,28 +307,28 @@ class ActivityMailerTest < ActionMailer::TestCase mentioned.user.update_columns(mail_notification: false, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.mentioned( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).deliver_now assert_empty ActionMailer::Base.deliveries mentioned.user.update_columns(mail_notification: false, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.mentioned( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).deliver_now assert_empty ActionMailer::Base.deliveries mentioned.user.update_columns(mail_notification: true, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.mentioned( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).deliver_now assert_empty ActionMailer::Base.deliveries mentioned.user.update_columns(mail_notification: true, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.mentioned( - mentionable: mentionable, + mentionable:, receiver: mentioned.user ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -387,7 +387,7 @@ class ActivityMailerTest < ActionMailer::TestCase ActivityMailer.checked( sender: check.sender, receiver: check.receiver, - check: check + check: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -404,7 +404,7 @@ class ActivityMailerTest < ActionMailer::TestCase mailer = ActivityMailer.with( sender: check.sender, receiver: check.receiver, - check: check + check: ).checked perform_enqueued_jobs do @@ -424,7 +424,7 @@ class ActivityMailerTest < ActionMailer::TestCase ActivityMailer.checked( sender: check.sender, receiver: users(:hajime), - check: check + check: ).deliver_now assert_empty ActionMailer::Base.deliveries @@ -435,8 +435,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:mentormentaro) ActivityMailer.create_page( - page: page, - receiver: receiver + page:, + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -453,8 +453,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:mentormentaro) mailer = ActivityMailer.with( - page: page, - receiver: receiver + page:, + receiver: ).create_page perform_enqueued_jobs do @@ -475,7 +475,7 @@ class ActivityMailerTest < ActionMailer::TestCase notification = notifications(:notification_moved_up_event_waiting_user) ActivityMailer.moved_up_event_waiting_user( receiver: notification.user, - event: event + event: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -492,7 +492,7 @@ class ActivityMailerTest < ActionMailer::TestCase notification = notifications(:notification_moved_up_event_waiting_user) mailer = ActivityMailer.moved_up_event_waiting_user( receiver: notification.user, - event: event + event: ) perform_enqueued_jobs do @@ -513,8 +513,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:mentormentaro) ActivityMailer.submitted( - receiver: receiver, - product: product + receiver:, + product: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -531,8 +531,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:mentormentaro) mailer = ActivityMailer.with( - receiver: receiver, - product: product + receiver:, + product: ).submitted perform_enqueued_jobs do @@ -553,8 +553,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:hajime) ActivityMailer.submitted( - receiver: receiver, - product: product + receiver:, + product: ).deliver_now assert_empty ActionMailer::Base.deliveries @@ -567,8 +567,8 @@ class ActivityMailerTest < ActionMailer::TestCase ActivityMailer.following_report( sender: user, - receiver: receiver, - report: report + receiver:, + report: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -587,8 +587,8 @@ class ActivityMailerTest < ActionMailer::TestCase mailer = ActivityMailer.with( sender: user, - receiver: receiver, - report: report + receiver:, + report: ).following_report perform_enqueued_jobs do @@ -631,8 +631,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = User.find(product.checker_id) ActivityMailer.assigned_as_checker( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -649,8 +649,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = User.find(product.checker_id) mailer = ActivityMailer.with( - product: product, - receiver: receiver + product:, + receiver: ).assigned_as_checker perform_enqueued_jobs do @@ -672,29 +672,29 @@ class ActivityMailerTest < ActionMailer::TestCase receiver.update_columns(mail_notification: false, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.assigned_as_checker( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: false, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.assigned_as_checker( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: true, retired_on: Date.current) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.assigned_as_checker( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_empty ActionMailer::Base.deliveries receiver.update_columns(mail_notification: true, retired_on: nil) # rubocop:disable Rails/SkipsModelValidations ActivityMailer.assigned_as_checker( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? end @@ -755,7 +755,7 @@ class ActivityMailerTest < ActionMailer::TestCase report = reports(:report10) first_report = notifications(:notification_first_report) ActivityMailer.first_report( - report: report, + report:, receiver: first_report.user ).deliver_now @@ -771,7 +771,7 @@ class ActivityMailerTest < ActionMailer::TestCase report = reports(:report10) first_report = notifications(:notification_first_report) mailer = ActivityMailer.with( - report: report, + report:, receiver: first_report.user ).first_report @@ -791,7 +791,7 @@ class ActivityMailerTest < ActionMailer::TestCase report = reports(:report16) consecutive_sad_report = notifications(:notification_consecutive_sad_report) ActivityMailer.consecutive_sad_report( - report: report, + report:, receiver: consecutive_sad_report.user ).deliver_now @@ -808,7 +808,7 @@ class ActivityMailerTest < ActionMailer::TestCase report = reports(:report16) consecutive_sad_report = notifications(:notification_consecutive_sad_report) mailer = ActivityMailer.with( - report: report, + report:, receiver: consecutive_sad_report.user ).consecutive_sad_report @@ -830,7 +830,7 @@ class ActivityMailerTest < ActionMailer::TestCase notification = notifications(:notification_regular_event_updated) ActivityMailer.update_regular_event( - regular_event: regular_event, + regular_event:, receiver: notification.user ).deliver_now @@ -847,7 +847,7 @@ class ActivityMailerTest < ActionMailer::TestCase notification = notifications(:notification_regular_event_updated) mailer = ActivityMailer.with( - regular_event: regular_event, + regular_event:, receiver: notification.user ).update_regular_event @@ -921,8 +921,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = answer.user ActivityMailer.chose_correct_answer( - answer: answer, - receiver: receiver + answer:, + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -939,8 +939,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = answer.user mailer = ActivityMailer.with( - answer: answer, - receiver: receiver + answer:, + receiver: ).chose_correct_answer perform_enqueued_jobs do @@ -962,8 +962,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver.update(mail_notification: false) mailer = ActivityMailer.with( - answer: answer, - receiver: receiver + answer:, + receiver: ).chose_correct_answer perform_enqueued_jobs do @@ -979,8 +979,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver.update(retired_on: Date.current) mailer = ActivityMailer.with( - answer: answer, - receiver: receiver + answer:, + receiver: ).chose_correct_answer perform_enqueued_jobs do @@ -994,7 +994,7 @@ class ActivityMailerTest < ActionMailer::TestCase question = questions(:question1) receiver = question.user - ActivityMailer.no_correct_answer(question: question, receiver: receiver).deliver_now + ActivityMailer.no_correct_answer(question:, receiver:).deliver_now assert_not ActionMailer::Base.deliveries.empty? email = ActionMailer::Base.deliveries.last @@ -1009,7 +1009,7 @@ class ActivityMailerTest < ActionMailer::TestCase question = questions(:question1) receiver = question.user - mailer = ActivityMailer.with(question: question, receiver: receiver).no_correct_answer + mailer = ActivityMailer.with(question:, receiver:).no_correct_answer perform_enqueued_jobs do mailer.deliver_later @@ -1029,8 +1029,8 @@ class ActivityMailerTest < ActionMailer::TestCase receiver = users(:komagata) ActivityMailer.product_update( - product: product, - receiver: receiver + product:, + receiver: ).deliver_now assert_not ActionMailer::Base.deliveries.empty? @@ -1056,7 +1056,7 @@ class ActivityMailerTest < ActionMailer::TestCase ) ActivityMailer.came_comment( - comment: comment, + comment:, message: "相談部屋で#{comment.sender.login_name}さんからコメントがありました。", receiver: comment.receiver ).deliver_now @@ -1083,7 +1083,7 @@ class ActivityMailerTest < ActionMailer::TestCase ) mailer = ActivityMailer.with( - comment: comment, + comment:, message: "相談部屋で#{comment.sender.login_name}さんからコメントがありました。", receiver: comment.receiver ).came_comment @@ -1107,7 +1107,7 @@ class ActivityMailerTest < ActionMailer::TestCase comment = comments(:commentOfTalk) ActivityMailer.came_comment( - comment: comment, + comment:, message: "相談部屋で#{comment.sender.login_name}さんからコメントがありました。", receiver: comment.receiver ).deliver_now diff --git a/test/mailers/notification_mailer_test.rb b/test/mailers/notification_mailer_test.rb index 7eb12877564..9f52c4cdca4 100644 --- a/test/mailers/notification_mailer_test.rb +++ b/test/mailers/notification_mailer_test.rb @@ -7,7 +7,7 @@ class NotificationMailerTest < ActionMailer::TestCase report = reports(:report11) trainee_report = notifications(:notification_trainee_report) mailer = NotificationMailer.with( - report: report, + report:, receiver: trainee_report.user ).trainee_report diff --git a/test/mailers/previews/activity_mailer_preview.rb b/test/mailers/previews/activity_mailer_preview.rb index 4f8f84ea930..98b4aa8ef9e 100644 --- a/test/mailers/previews/activity_mailer_preview.rb +++ b/test/mailers/previews/activity_mailer_preview.rb @@ -7,7 +7,7 @@ def came_comment comment = Comment.find(ActiveRecord::FixtureSet.identify(:commentOfTalk)) ActivityMailer.with( - comment: comment, + comment:, message: "相談部屋で#{comment.sender.login_name}さんからコメントがありました。", receiver: comment.receiver ).came_comment @@ -17,19 +17,19 @@ def graduated sender = User.find(ActiveRecord::FixtureSet.identify(:sotugyou)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - ActivityMailer.with(sender: sender, receiver: receiver).graduated + ActivityMailer.with(sender:, receiver:).graduated end def checked check = Check.find(ActiveRecord::FixtureSet.identify(:procuct2_check_komagata)) - ActivityMailer.with(receiver: check.receiver, check: check).checked + ActivityMailer.with(receiver: check.receiver, check:).checked end def came_answer question = Question.find(ActiveRecord::FixtureSet.identify(:question2)) answer = question.answers.first - ActivityMailer.with(answer: answer).came_answer + ActivityMailer.with(answer:).came_answer end def post_announcement @@ -38,7 +38,7 @@ def post_announcement ActivityMailer.with( announcement: announce, - receiver: receiver + receiver: ).post_announcement end @@ -46,14 +46,14 @@ def came_question receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) question = Question.find(ActiveRecord::FixtureSet.identify(:question1)) - ActivityMailer.with(sender: question.user, receiver: receiver, question: question).came_question + ActivityMailer.with(sender: question.user, receiver:, question:).came_question end def retired sender = User.find(ActiveRecord::FixtureSet.identify(:yameo)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - ActivityMailer.with(sender: sender, receiver: receiver).retired + ActivityMailer.with(sender:, receiver:).retired end def mentioned @@ -61,14 +61,14 @@ def mentioned report = Report.find(ActiveRecord::FixtureSet.identify(:report5)) receiver = report.user - ActivityMailer.with(mentionable: mentionable, receiver: receiver).mentioned + ActivityMailer.with(mentionable:, receiver:).mentioned end def create_page page = Page.find(ActiveRecord::FixtureSet.identify(:page4)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - ActivityMailer.with(sender: page.user, receiver: receiver, page: page).create_page + ActivityMailer.with(sender: page.user, receiver:, page:).create_page end def moved_up_event_waiting_user @@ -76,8 +76,8 @@ def moved_up_event_waiting_user receiver = User.find(ActiveRecord::FixtureSet.identify(:hatsuno)) ActivityMailer.with( - event: event, - receiver: receiver + event:, + receiver: ).moved_up_event_waiting_user end @@ -85,7 +85,7 @@ def submitted product = Product.find(ActiveRecord::FixtureSet.identify(:product15)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - ActivityMailer.with(product: product, receiver: receiver).submitted + ActivityMailer.with(product:, receiver:).submitted end def following_report @@ -94,9 +94,9 @@ def following_report receiver = User.find(ActiveRecord::FixtureSet.identify(:muryou)) ActivityMailer.with( - report: report, - sender: sender, - receiver: receiver + report:, + sender:, + receiver: ).following_report end @@ -107,10 +107,10 @@ def watching_noitification sender = comment.user ActivityMailer.with( - watchable: watchable, - receiver: receiver, - sender: sender, - comment: comment + watchable:, + receiver:, + sender:, + comment: ).watching_notification end @@ -118,21 +118,21 @@ def assigned_as_checker product = Product.find(ActiveRecord::FixtureSet.identify(:product71)) receiver = User.find(product.checker_id) - ActivityMailer.with(product: product, receiver: receiver).assigned_as_checker + ActivityMailer.with(product:, receiver:).assigned_as_checker end def hibernated sender = User.find(ActiveRecord::FixtureSet.identify(:hatsuno)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - ActivityMailer.with(sender: sender, receiver: receiver).hibernated + ActivityMailer.with(sender:, receiver:).hibernated end def first_report report = Report.find(ActiveRecord::FixtureSet.identify(:report10)) receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) - ActivityMailer.with(report: report, receiver: receiver).first_report + ActivityMailer.with(report:, receiver:).first_report end def consecutive_sad_report @@ -140,34 +140,34 @@ def consecutive_sad_report notification = Notification.find(ActiveRecord::FixtureSet.identify(:notification_consecutive_sad_report)) receiver = notification.user - ActivityMailer.with(report: report, receiver: receiver).consecutive_sad_report + ActivityMailer.with(report:, receiver:).consecutive_sad_report end def update_regular_event regular_event = RegularEvent.find(ActiveRecord::FixtureSet.identify(:regular_event1)) receiver = User.find(ActiveRecord::FixtureSet.identify(:hatsuno)) - ActivityMailer.with(regular_event: regular_event, receiver: receiver).update_regular_event + ActivityMailer.with(regular_event:, receiver:).update_regular_event end def signed_up sender = ActiveDecorator::Decorator.instance.decorate(User.find(ActiveRecord::FixtureSet.identify(:hajime))) receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) - ActivityMailer.with(sender: sender, receiver: receiver, sender_roles: sender.roles_to_s).signed_up + ActivityMailer.with(sender:, receiver:, sender_roles: sender.roles_to_s).signed_up end def chose_correct_answer answer = Answer.find(ActiveRecord::FixtureSet.identify(:correct_answer1)) receiver = User.find(answer.user_id) - ActivityMailer.with(answer: answer, receiver: receiver).chose_correct_answer + ActivityMailer.with(answer:, receiver:).chose_correct_answer end def no_correct_answer question = Question.find(ActiveRecord::FixtureSet.identify(:question1)) receiver = User.find(question.user_id) - ActivityMailer.with(question: question, receiver: receiver).no_correct_answer + ActivityMailer.with(question:, receiver:).no_correct_answer end end diff --git a/test/mailers/previews/notification_mailer_preview.rb b/test/mailers/previews/notification_mailer_preview.rb index b73623a4886..7ced2eed3b0 100644 --- a/test/mailers/previews/notification_mailer_preview.rb +++ b/test/mailers/previews/notification_mailer_preview.rb @@ -8,48 +8,48 @@ def mentioned mentionable = Comment.find(ActiveRecord::FixtureSet.identify(:comment9)) receiver = report.user - NotificationMailer.with(mentionable: mentionable, receiver: receiver).mentioned + NotificationMailer.with(mentionable:, receiver:).mentioned end def checked report = Report.find(ActiveRecord::FixtureSet.identify(:report5)) check = report.checks.first - NotificationMailer.with(check: check).checked + NotificationMailer.with(check:).checked end def retired sender = User.find(ActiveRecord::FixtureSet.identify(:yameo)) receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) - NotificationMailer.with(sender: sender, receiver: receiver).retired + NotificationMailer.with(sender:, receiver:).retired end def trainee_report report = Report.find(ActiveRecord::FixtureSet.identify(:report11)) receiver = User.find(ActiveRecord::FixtureSet.identify(:senpai)) - NotificationMailer.with(report: report, receiver: receiver).trainee_report + NotificationMailer.with(report:, receiver:).trainee_report end def chose_correct_answer answer = Answer.find(ActiveRecord::FixtureSet.identify(:correct_answer2)) receiver = answer.sender - NotificationMailer.with(answer: answer, receiver: receiver).chose_correct_answer + NotificationMailer.with(answer:, receiver:).chose_correct_answer end def graduated sender = User.find(ActiveRecord::FixtureSet.identify(:sotugyou)) receiver = User.find(ActiveRecord::FixtureSet.identify(:mentormentaro)) - NotificationMailer.with(sender: sender, receiver: receiver).graduated + NotificationMailer.with(sender:, receiver:).graduated end def product_update product = Product.find(ActiveRecord::FixtureSet.identify(:product1)) receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) - NotificationMailer.with(product: product, receiver: receiver).product_update + NotificationMailer.with(product:, receiver:).product_update end end diff --git a/test/models/answer_test.rb b/test/models/answer_test.rb index f9ce9acdcec..f6a36035f45 100644 --- a/test/models/answer_test.rb +++ b/test/models/answer_test.rb @@ -17,7 +17,7 @@ class AnswerTest < ActiveSupport::TestCase answer = Answer.create!( description: '最後の回答', user: answerer, - question: question, + question:, created_at: '2022-10-31', updated_at: '2022-10-31' ) diff --git a/test/models/bookmark_test.rb b/test/models/bookmark_test.rb index 516685c496c..9151ea63562 100644 --- a/test/models/bookmark_test.rb +++ b/test/models/bookmark_test.rb @@ -7,39 +7,39 @@ class BookmarkTest < ActiveSupport::TestCase user = users(:machida) report = reports(:report1) - Bookmark.create(user: user, bookmarkable: report) - assert_not Bookmark.new(user: user, bookmarkable: report).valid? + Bookmark.create(user:, bookmarkable: report) + assert_not Bookmark.new(user:, bookmarkable: report).valid? end test 'prohibit to duplicate question registration' do user = users(:kimura) question = questions(:question1) - Bookmark.create(user: user, bookmarkable: question) - assert_not Bookmark.new(user: user, bookmarkable: question).valid? + Bookmark.create(user:, bookmarkable: question) + assert_not Bookmark.new(user:, bookmarkable: question).valid? end test 'prohibit to duplicate product registration' do user = users(:kimura) product = products(:product1) - Bookmark.create(user: user, bookmarkable: product) - assert_not Bookmark.new(user: user, bookmarkable: product).valid? + Bookmark.create(user:, bookmarkable: product) + assert_not Bookmark.new(user:, bookmarkable: product).valid? end test 'prohibit to duplicate page registration' do user = users(:kimura) page = pages(:page1) - Bookmark.create(user: user, bookmarkable: page) - assert_not Bookmark.new(user: user, bookmarkable: page).valid? + Bookmark.create(user:, bookmarkable: page) + assert_not Bookmark.new(user:, bookmarkable: page).valid? end test 'prohibit to duplicate talk registration' do user = users(:komagata) talk = talks(:talk1) - Bookmark.create(user: user, bookmarkable: talk) - assert_not Bookmark.new(user: user, bookmarkable: talk).valid? + Bookmark.create(user:, bookmarkable: talk) + assert_not Bookmark.new(user:, bookmarkable: talk).valid? end end diff --git a/test/models/category_test.rb b/test/models/category_test.rb index a8c6feaed7a..eebd35d1814 100644 --- a/test/models/category_test.rb +++ b/test/models/category_test.rb @@ -8,6 +8,6 @@ class CategoryTest < ActiveSupport::TestCase course = courses(:course1) category = categories(:category2) - assert_equal category, Category.category(practice: practice, course: course) + assert_equal category, Category.category(practice:, course:) end end diff --git a/test/models/discord/times_channel_test.rb b/test/models/discord/times_channel_test.rb index 735e156d5c8..b15fa4e88d8 100644 --- a/test/models/discord/times_channel_test.rb +++ b/test/models/discord/times_channel_test.rb @@ -8,7 +8,7 @@ class TimesChannelTest < ActiveSupport::TestCase @stub_create_text_channel = lambda { |name:, parent:| Discordrb::Channel.new({ id: '1234567890', - name: name, + name:, parent_id: parent }.stringify_keys, nil) } diff --git a/test/models/event_test.rb b/test/models/event_test.rb index 47e0e318621..403779bbb13 100644 --- a/test/models/event_test.rb +++ b/test/models/event_test.rb @@ -68,7 +68,7 @@ class EventTest < ActiveSupport::TestCase event = events(:event3) user = users(:hatsuno) event.send_notification(user) - assert Notification.where(user: user, sender: event.user, link: "/events/#{event.id}").exists? + assert Notification.where(user:, sender: event.user, link: "/events/#{event.id}").exists? end test '#holding_today?' do From cccf45414fa51d60aa3bdf2fc7dd99bcd6c6acd3 Mon Sep 17 00:00:00 2001 From: a-terumoto-gs Date: Tue, 20 Feb 2024 18:03:50 +0900 Subject: [PATCH 62/65] =?UTF-8?q?#=E5=89=8D=E3=81=AE=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/slim_lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/slim_lint.yml b/config/slim_lint.yml index b05b6c15b66..6ec54d94d72 100644 --- a/config/slim_lint.yml +++ b/config/slim_lint.yml @@ -25,11 +25,11 @@ linters: - Layout/MultilineOperationIndentation - Layout/ParameterAlignment - Layout/TrailingEmptyLines - - Lint/Void # 除外検討したが見送り - - Metrics/BlockLength # 除外検討したが見送り + - Lint/Void # 除外検討したが見送り + - Metrics/BlockLength # 除外検討したが見送り - Metrics/BlockNesting - Naming/FileName - - Style/FrozenStringLiteralComment # 除外検討したが見送り + - Style/FrozenStringLiteralComment # 除外検討したが見送り - Style/IdenticalConditionalBranches - Style/IfUnlessModifier - Style/Next From 4f18d7995c327621782a5484aa035c5a1d2be667 Mon Sep 17 00:00:00 2001 From: masyuko0222 Date: Tue, 20 Feb 2024 19:44:38 +0900 Subject: [PATCH 63/65] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=A0=E3=81=91=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rubocop_todo.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 2f751e026e3..00000000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1000` -# on 2023-07-02 06:34:03 UTC using RuboCop version 1.37.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 386 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. -# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -# SupportedShorthandSyntax: always, never, either, consistent From 3ad31456d8432a75589366f9718c94bc492687e7 Mon Sep 17 00:00:00 2001 From: masyuko0222 Date: Tue, 20 Feb 2024 20:30:05 +0900 Subject: [PATCH 64/65] =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92rubocop.yml?= =?UTF-8?q?=E3=81=8B=E3=82=89=E3=82=82=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rubocop.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 04b6c5d4cd8..733b5bf4e19 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,8 +2,6 @@ require: - rubocop-minitest - rubocop-capybara -inherit_from: .rubocop_todo.yml - inherit_gem: rubocop-fjord: - config/rubocop.yml From 82bc25e4fdaacf07a590749530b116f1bffef9c2 Mon Sep 17 00:00:00 2001 From: komagata Date: Wed, 21 Feb 2024 06:31:10 +0900 Subject: [PATCH 65/65] =?UTF-8?q?=E3=82=B5=E3=83=96=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E6=99=82=E3=81=AB=E7=A8=8E=E7=8E=87=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit インボイス対応の領収書表示のため。 --- app/models/subscription.rb | 5 ++++- config/secrets.yml | 2 ++ test/cassettes/subscription/create.yml | 6 +++++- test/models/subscription_test.rb | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 66c9c77d6cc..d8c66f66b58 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -15,7 +15,10 @@ def retrieve(id) def create(customer_id, idempotency_key = SecureRandom.uuid, trial: 3) options = { customer: customer_id, - items: [{ plan: Plan.standard_plan.id }] + items: [{ + plan: Plan.standard_plan.id, + tax_rates: [Rails.application.secrets[:stripe][:tax_rate_id]] + }] } options[:trial_end] = trial.days.since.to_i if trial.positive? diff --git a/config/secrets.yml b/config/secrets.yml index b0e60e23154..7c4c5b7e5a6 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -26,6 +26,7 @@ shared: public_key: pk_test_Je8A9BUHRC8oqsqx8wtfbKwg secret_key: sk_test_XLP1Ajz1JvT9jUt5uKGvL0Wd endpoint_secret: 'whsec_7bed86b552fc378b10af3cc11a371e8f3454c5817ba44ac9fc5092bf50056075' + tax_rate_id: <%= ENV['STRIPE_TAX_RATE_ID'] || 'txr_1Om0YyBpeWcLFd8fovSLFgXX' %> open_ai: access_token: <%= ENV['OPEN_AI_ACCESS_TOKEN'] || 'xxxxxxxx' %> @@ -36,3 +37,4 @@ production: public_key: <%= ENV['STRIPE_PUBLIC_KEY'] %> secret_key: <%= ENV['STRIPE_SECRET_KEY'] %> endpoint_secret: '<%= ENV['STRIPE_ENDPOINT_SECRET'] %>' + tax_rate_id: <%= ENV['STRIPE_TAX_RATE_ID'] %> diff --git a/test/cassettes/subscription/create.yml b/test/cassettes/subscription/create.yml index ef908b4fda9..098a4aefa57 100644 --- a/test/cassettes/subscription/create.yml +++ b/test/cassettes/subscription/create.yml @@ -101,7 +101,11 @@ http_interactions: uri: https://api.stripe.com/v1/subscriptions body: encoding: UTF-8 - string: customer=cus_12345678&items[0][plan]=price_1J0hhTBpeWcLFd8ffLjm4nKO&trial_end=1672758000 + base64_string: | + Y3VzdG9tZXI9Y3VzXzEyMzQ1Njc4Jml0ZW1zWzBdW3BsYW5dPXByaWNlXzFK + cmxPeEJwZVdjTEZkOGZkNXJneDA4YyZpdGVtc1swXVt0YXhfcmF0ZXNdWzBd + PXR4cl8xT20wWXlCcGVXY0xGZDhmb3ZTTEZnWFgmdHJpYWxfZW5kPTE2NzI3 + NTgwMDA= headers: User-Agent: - Stripe/v1 RubyBindings/4.5.0 diff --git a/test/models/subscription_test.rb b/test/models/subscription_test.rb index 6cc352778bf..b6be7b65fba 100644 --- a/test/models/subscription_test.rb +++ b/test/models/subscription_test.rb @@ -12,7 +12,7 @@ class SubscriptionTest < ActiveSupport::TestCase test '#create' do travel_to Time.zone.parse('2023-01-01 00:00:00') do - VCR.use_cassette 'subscription/create' do + VCR.use_cassette 'subscription/create', record: :once, match_requests_on: %i[method uri] do subscription = Subscription.new.create('cus_12345678') assert_equal 'sub_12345678', subscription['id'] end