diff options
Diffstat (limited to 'spec/features/admin/admin_broadcast_messages_spec.rb')
-rw-r--r-- | spec/features/admin/admin_broadcast_messages_spec.rb | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index c5a302ce78b..bf7f8563e68 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -13,7 +13,7 @@ describe 'Admin Broadcast Messages' do expect(page).to have_content 'Migration to new server' end - it 'Create a customized broadcast message' do + it 'creates a customized broadcast banner message' do fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**' fill_in 'broadcast_message_color', with: '#f2dede' fill_in 'broadcast_message_target_path', with: '*/user_onboarded' @@ -28,6 +28,20 @@ describe 'Admin Broadcast Messages' do expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"]) end + it 'creates a customized broadcast notification message' do + fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**' + fill_in 'broadcast_message_target_path', with: '*/user_onboarded' + select 'Notification', from: 'broadcast_message_broadcast_type' + select Date.today.next_year.year, from: 'broadcast_message_ends_at_1i' + click_button 'Add broadcast message' + + expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' + expect(page).to have_content '*/user_onboarded' + expect(page).to have_content 'Notification' + expect(page).to have_selector 'strong', text: '4:00 CST to 5:00 CST' + end + it 'Edit an existing broadcast message' do click_link 'Edit' fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' @@ -44,10 +58,20 @@ describe 'Admin Broadcast Messages' do expect(page).not_to have_content 'Migration to new server' end - it 'Live preview a customized broadcast message', :js do + it 'updates a preview of a customized broadcast banner message', :js do + fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:" + + page.within('.js-broadcast-banner-message-preview') do + expect(page).to have_selector('strong', text: 'Markdown') + expect(page).to have_emoji('tada') + end + end + + it 'updates a preview of a customized broadcast notification message', :js do fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:" + select 'Notification', from: 'broadcast_message_broadcast_type' - page.within('.broadcast-message-preview') do + page.within('.js-broadcast-notification-message-preview') do expect(page).to have_selector('strong', text: 'Markdown') expect(page).to have_emoji('tada') end |