Use buttons to send notifications and newsletters

As mentioned in commits 5311daadf and bb958daf0, using links combined
with JavaScript to generate POST requests to the server has a few
issues.
This commit is contained in:
Javi Martín
2021-08-20 01:24:40 +02:00
parent 09321f41a7
commit 52ec55970b
5 changed files with 25 additions and 17 deletions

View File

@@ -190,7 +190,7 @@ describe "Admin Notifications", :admin do
visit admin_admin_notification_path(notification)
accept_confirm { click_link "Send notification" }
accept_confirm { click_button "Send notification" }
expect(page).to have_content "Notification sent successfully"

View File

@@ -134,7 +134,7 @@ describe "Admin newsletter emails", :admin do
newsletter = create(:newsletter)
visit admin_newsletter_path(newsletter)
accept_confirm { click_link "Send" }
accept_confirm { click_button "Send" }
expect(page).to have_content "Newsletter sent successfully"
end
@@ -153,7 +153,7 @@ describe "Admin newsletter emails", :admin do
newsletter = create(:newsletter, segment_recipient: "administrators")
visit admin_newsletter_path(newsletter)
accept_confirm { click_link "Send" }
accept_confirm { click_button "Send" }
expect(page).to have_content "Newsletter sent successfully"