diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index e831695c51..2b7e598a4e 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -664,16 +664,16 @@ RSpec.describe ' end it "finally, can invite unregistered users" do - within ".reveal-modal" do - tomselect_fill_in "user_invitation[email]", with: "email@email.com" + expect do + within ".reveal-modal" do + tomselect_fill_in "user_invitation[email]", with: "email@email.com" - expect do click_button "Invite" - end.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) - end + end - expect(page) - .to have_content "email@email.com has been invited to manage this enterprise" + expect(page) + .to have_content "email@email.com has been invited to manage this enterprise" + end.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) end end end