Skip to content

ダイアログの影響でFlakyになっていたシステムテストを修正#8513

Merged
komagata merged 3 commits intomainfrom
bug/fix-sponsorships-test
Apr 2, 2025
Merged

ダイアログの影響でFlakyになっていたシステムテストを修正#8513
komagata merged 3 commits intomainfrom
bug/fix-sponsorships-test

Conversation

@lsesmpmido
Copy link
Copy Markdown
Contributor

@lsesmpmido lsesmpmido commented Apr 1, 2025

Issue

概要

#8346 で追加されたアラート機能に
sponsorships_test.rbのコードを対応させました

変更確認方法

  1. ブランチbug/fix-sponsorships-testをローカルに取り込む
    1. git fetch origin bug/fix-sponsorships-test
    2. git switch bug/fix-sponsorships-test
  2. test/system/article/sponsorships_test.rbのファイルを開く
  3. Screenshotの「変更後」のように、赤線の内容に修正されていることを確認する
  4. rails test test/system/article/sponsorships_test.rbを実行して自動テストが合格することを確認する

Screenshot

変更前

image

変更後

image

@lsesmpmido lsesmpmido marked this pull request as ready for review April 1, 2025 11:35
@lsesmpmido
Copy link
Copy Markdown
Contributor Author

@komagata さん
今回のリリース以降、sponsorships_test.rbで生じるエラーを修正いたしました。
machidaさんより、mainブランチのバグは受講生レビューは飛ばして良いと指示を頂きましたので
お手すきの際にレビューの確認をお願いいたします

@@ -8,7 +8,9 @@ class Article::SponsorshipsTest < ApplicationSystemTestCase
fill_in 'タイトル', with: 'sponsorshipページに表示される記事のタイトルです。'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今回の変更とは別の行になりますが、Webからデータを入れるとDBに直接入れるのの1000倍は遅いと思うので修正したいです。特にこのテストはタイトルからすると表示の確認が目的で、データ追加は関係ないのでなおさらDBに直接入れたいです。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@komagata さん
お疲れ様です
以前のWebからデータを追加する書き方ではなく、Article.create!()でデータを追加する書き方に修正いたしました。お手すきの際にレビューの確認をお願いいたします

@lsesmpmido lsesmpmido self-assigned this Apr 2, 2025
@lsesmpmido lsesmpmido force-pushed the bug/fix-sponsorships-test branch from 4413382 to 564068d Compare April 2, 2025 07:39
Copy link
Copy Markdown
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認させて頂きました。OKです〜🙆‍♂️

@komagata komagata merged commit 0f2b647 into main Apr 2, 2025
3 checks passed
@komagata komagata deleted the bug/fix-sponsorships-test branch April 2, 2025 13:22
@github-actions github-actions bot mentioned this pull request Apr 2, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants