Skip to content
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

開催前の定期イベントは次回開催日を表示しない #7995

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/views/regular_events/_regular_event_meta.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
dt.event-meta__item-label
| 次回開催日
dd.event-meta__item-value
= regular_event.next_holding_date
- if regular_event.wip?
| イベント編集中のため次回開催日は未定です
- else
= regular_event.next_holding_date
23 changes: 23 additions & 0 deletions test/system/regular_events_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ class RegularEventsTest < ApplicationSystemTestCase
assert_text regular_event.description
end

test 'show regular event as WIP' do
visit_with_auth new_regular_event_path, 'komagata'
within 'form[name=regular_event]' do
fill_in 'regular_event[title]', with: 'WIPの定期イベント表示確認用'
first('.choices__inner').click
find('#choices--js-choices-multiple-select-item-choice-1').click
find('label', text: '主催者').click
find('label', text: '質問').click
fill_in 'regular_event[start_at]', with: Time.zone.parse('21:00')
fill_in 'regular_event[end_at]', with: Time.zone.parse('22:00')
fill_in 'regular_event[description]', with: '定期イベントがWIPのときの次回開催日時の表示確認を行うための定期イベント'
assert_difference 'RegularEvent.count', 1 do
click_button 'WIP'
end
end

visit_with_auth regular_event_path(RegularEvent.last), 'komagata'
assert_equal 'WIPの定期イベント表示確認用 | FBC', title
assert_text '毎週日曜日21:00 〜 22:00(祝日は休み)'
assert_text 'イベント編集中のため次回開催日は未定です'
assert_text '定期イベントがWIPのときの次回開催日時の表示確認を行うための定期イベント'
end

test 'update regular event' do
visit_with_auth edit_regular_event_path(regular_events(:regular_event1)), 'komagata'
assert_no_selector 'label', text: '定期イベント公開のお知らせを書く'
Expand Down