Use Selenium API to accept/dismiss JS modals/browser alerts
JS modals/browser alerts are not automatically accepted now with Selenium, events that trigger such events must be wrapped in one of the following methods: `accept_alert`, `accept_confirm` or `dismiss_confirm`
This commit is contained in:
@@ -130,11 +130,9 @@ feature "Admin newsletter emails" do
|
||||
scenario "Sends newsletter emails", :js do
|
||||
newsletter = create(:newsletter)
|
||||
visit admin_newsletter_path(newsletter)
|
||||
|
||||
click_link "Send"
|
||||
|
||||
total_users = newsletter.list_of_recipient_emails.count
|
||||
page.accept_confirm("Are you sure you want to send this newsletter to #{total_users} users?")
|
||||
|
||||
accept_confirm { click_link "Send" }
|
||||
|
||||
expect(page).to have_content "Newsletter sent successfully"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user