-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一度公開したお知らせを誰でも公開の状態で保存できるように変更 #4215
Merged
komagata
merged 4 commits into
main
from
feature/change-anyone-can-republish-announcement
Feb 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,20 +140,51 @@ class AnnouncementsTest < ApplicationSystemTestCase | |
assert_no_text 'お知らせ「就活希望者のみお知らせします」' | ||
end | ||
|
||
test "general user can't edit submitted announcement" do | ||
announcement = announcements(:announcement1) | ||
visit_with_auth announcement_path(announcement), 'kimura' | ||
test "general user can't create announcement" do | ||
visit_with_auth '/announcements', 'kimura' | ||
click_link 'お知らせ作成' | ||
assert has_no_button? '作成' | ||
assert_text 'お知らせを作成しましたら、WIPで保存し、作成したお知らせのコメントから @mentor へ確認・公開の連絡をお願いします。' | ||
end | ||
|
||
test 'admin user can publish wip announcement' do | ||
announcement = announcements(:announcement_wip) | ||
visit_with_auth announcement_path(announcement), 'komagata' | ||
within '.thread__inner' do | ||
assert_no_text '内容修正' | ||
click_link '内容修正' | ||
end | ||
assert has_button? '公開' | ||
assert_no_text 'お知らせを作成しましたら、WIPで保存し、作成したお知らせのコメントから @mentor へ確認・公開の連絡をお願いします。' | ||
end | ||
|
||
test 'general user can edit wip announcement' do | ||
test "general user can't publish wip announcement" do | ||
announcement = announcements(:announcement_wip) | ||
visit_with_auth announcement_path(announcement), 'kimura' | ||
within '.thread__inner' do | ||
assert_text '内容修正' | ||
click_link '内容修正' | ||
end | ||
assert has_no_button? '公開' | ||
assert_text 'お知らせを作成しましたら、WIPで保存し、作成したお知らせのコメントから @mentor へ確認・公開の連絡をお願いします。' | ||
end | ||
|
||
test 'adimin user can publish submitted announcement' do | ||
announcement = announcements(:announcement1) | ||
visit_with_auth announcement_path(announcement), 'komagata' | ||
within '.thread__inner' do | ||
click_link '内容修正' | ||
end | ||
assert has_button? '公開' | ||
assert_no_text 'お知らせを作成しましたら、WIPで保存し、作成したお知らせのコメントから @mentor へ確認・公開の連絡をお願いします。' | ||
end | ||
|
||
test 'general user can publish submitted announcement' do | ||
announcement = announcements(:announcement1) | ||
visit_with_auth announcement_path(announcement), 'kimura' | ||
within '.thread__inner' do | ||
click_link '内容修正' | ||
end | ||
assert has_button? '公開' | ||
assert_no_text 'お知らせを作成しましたら、WIPで保存し、作成したお知らせのコメントから @mentor へ確認・公開の連絡をお願いします。' | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. デシジョンテーブルでどのようなテストケースが必要か明記してくださっているので、コードレビューがとてもしやすいです! |
||
test 'general user can copy submitted announcement' do | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aim2bpg
こちら、デシジョンテーブルのパターン1の要件を満たしていることを確認できました!
コードもネストが無くなり読みやすくなっていて、素晴らしいと思いました👏
今回のissueとは直接関係ないのですが「作成と公開の違い」が気になりました。
komagataさんでログインし、作成と公開の両方を行ってみましたが、どちらのボタンを押しても「公開」を行っているように見えました🤔
なぜ「メンターor管理者ログイン時 かつ お知らせ新規作成時 に作成ボタンが表示」されるのかが少し気になりました。
過去のissueを探しても分からなかったため、もしご存知でしたら教えていただけますと幸いです🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら、たしかに自分も気になりました😅
といった解釈ですね。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aim2bpg☺️
なるほど、そのような使い分け方なら納得です〜
ありがとうございます