diff --git a/app/views/admin/admin_notifications/show.html.erb b/app/views/admin/admin_notifications/show.html.erb
index ad2445edf..e78ecb875 100644
--- a/app/views/admin/admin_notifications/show.html.erb
+++ b/app/views/admin/admin_notifications/show.html.erb
@@ -64,12 +64,17 @@
<% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %>
- <%= link_to t("admin.admin_notifications.show.send"),
- deliver_admin_admin_notification_path(@admin_notification),
- "data-alert": t("admin.admin_notifications.show.send_alert",
- n: @admin_notification.list_of_recipients_count),
- method: :post,
- id: "js-send-admin_notification-alert",
- class: "button success expanded" %>
+ <%= render Admin::ActionComponent.new(
+ :deliver,
+ @admin_notification,
+ text: t("admin.admin_notifications.show.send"),
+ method: :post,
+ "data-alert": t(
+ "admin.admin_notifications.show.send_alert",
+ n: @admin_notification.list_of_recipients_count
+ ),
+ id: "js-send-admin_notification-alert",
+ class: "button success expanded",
+ ) %>
<% end %>
diff --git a/app/views/admin/newsletters/show.html.erb b/app/views/admin/newsletters/show.html.erb
index 3065b8bff..a9def3756 100644
--- a/app/views/admin/newsletters/show.html.erb
+++ b/app/views/admin/newsletters/show.html.erb
@@ -56,10 +56,13 @@
<% if @newsletter.draft? && @newsletter.valid_segment_recipient? %>
- <%= link_to t("admin.newsletters.show.send"),
- deliver_admin_newsletter_path(@newsletter),
- "data-alert": t("admin.newsletters.show.send_alert", n: recipients_count),
- method: :post,
- id: "js-send-newsletter-alert",
- class: "button success" %>
+ <%= render Admin::ActionComponent.new(
+ :deliver,
+ @newsletter,
+ text: t("admin.newsletters.show.send"),
+ method: :post,
+ "data-alert": t("admin.newsletters.show.send_alert", n: recipients_count),
+ id: "js-send-newsletter-alert",
+ class: "button success"
+ ) %>
<% end %>
diff --git a/spec/system/admin/admin_notifications_spec.rb b/spec/system/admin/admin_notifications_spec.rb
index 52b881f9c..0f15ce649 100644
--- a/spec/system/admin/admin_notifications_spec.rb
+++ b/spec/system/admin/admin_notifications_spec.rb
@@ -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"
diff --git a/spec/system/admin/emails/newsletters_spec.rb b/spec/system/admin/emails/newsletters_spec.rb
index ed5dd7d08..5d8101c0f 100644
--- a/spec/system/admin/emails/newsletters_spec.rb
+++ b/spec/system/admin/emails/newsletters_spec.rb
@@ -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"
diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb
index 5d488053f..592aceb8d 100644
--- a/spec/system/emails_spec.rb
+++ b/spec/system/emails_spec.rb
@@ -482,7 +482,7 @@ describe "Emails" do
expect(page).to have_content "Newsletter created successfully"
- accept_confirm { click_link "Send" }
+ accept_confirm { click_button "Send" }
expect(page).to have_content "Newsletter sent successfully"