Skip to content

Commit

Permalink
Docを初回公開する時のみ「Doc公開」、それ以外は「内容を更新」と表示するようボタンテキストを変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryooo-k committed Oct 1, 2024
1 parent dbdec00 commit 3025021
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/views/pages/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@
i.fa-solid.fa-question

= button_tag(class: 'a-button is-lg is-primary is-block') do
- case params[:action]
- when 'new', 'create'
- if page.published_at.blank?
| Docを公開
- when 'edit', 'update'
- else
| 内容を更新
li.form-actions__item.is-sub
- case params[:action]
Expand Down
2 changes: 1 addition & 1 deletion test/system/notification/pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Notification::PagesTest < ApplicationSystemTestCase
visit_with_auth page_path(page), 'komagata'

click_link '内容変更'
click_button '内容を更新'
click_button 'Docを公開'
assert_text 'ドキュメントを更新しました。'

visit_with_auth '/notifications', 'machida'
Expand Down
4 changes: 2 additions & 2 deletions test/system/pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class PagesTest < ApplicationSystemTestCase
stub_info = proc { |i| mock_log << i }

Rails.logger.stub(:info, stub_info) do
click_button '内容を更新'
click_button 'Docを公開'
end

assert_text 'ドキュメントを更新しました。'
Expand Down Expand Up @@ -312,7 +312,7 @@ class PagesTest < ApplicationSystemTestCase
click_button 'WIP'

check 'ドキュメント公開のお知らせを書く', allow_label_click: true
click_button '内容を更新'
click_button 'Docを公開'

assert_text 'ドキュメントを更新しました。'
assert has_field?('announcement[title]', with: 'ドキュメント「お知らせにチェックを入れてWIP状態から新規Docを作成」を公開しました。')
Expand Down

0 comments on commit 3025021

Please sign in to comment.