Skip to content

Commit

Permalink
Merge pull request #7116 from fjordllc/bug/make-alert-about-wip-produ…
Browse files Browse the repository at this point in the history
…ct-visible-only-to-the-product-submitter

提出物がWIP状態のとき、WIPであることのアラートが提出物作成者にだけ表示されるように修正
  • Loading branch information
komagata authored Dec 14, 2023
2 parents defdaf3 + c5b8aa1 commit 08d0403
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/products/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ header.page-header
- if @product.user == current_user && [email protected]? && [email protected]? && @product.commented_users.mentor.empty?
= render 'message_for_after_submission'

- if @product.wip?
- if @product.wip? && @product.user == current_user
= render 'message_for_wip'

- if @product.user == current_user && @learning&.complete?
Expand Down
13 changes: 13 additions & 0 deletions test/system/products_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ class ProductsTest < ApplicationSystemTestCase
assert_text '本文を入力してください'
end

test 'user who has submitted a WIP product is alerted in the product page' do
wip_product = products(:product5)
visit_with_auth "/products/#{wip_product.id}", 'kimura'
assert_text "提出物はまだ提出されていません。\n完成したら「提出する」をクリック!"
end

test "user is not alerted in the other's WIP product page" do
wip_product = products(:product5)
visit_with_auth "/products/#{wip_product.id}", 'hatsuno'
assert_equal "#{wip_product.practice.title} | FBC", title
assert_no_text "提出物はまだ提出されていません。\n完成したら「提出する」をクリック!"
end

test "Don't notify if create product as WIP" do
visit_with_auth '/notifications', 'komagata'
click_link '全て既読にする'
Expand Down

0 comments on commit 08d0403

Please sign in to comment.