ticket_agent_default_notifications_controller_spec.rb 570 B

123456789101112131415
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Settings::TicketAgentDefaultNotificationsController, authenticated_as: :user, type: :request do
  4. let(:user) { create(:admin) }
  5. describe '#apply_to_all', performs_jobs: true do
  6. it 'schedules a background job' do
  7. expect do
  8. post '/api/v1/settings/ticket_agent_default_notifications/apply_to_all', params: {}, as: :json
  9. end.to have_enqueued_job(ResetNotificationsPreferencesJob).with(send_to_when_done: user.id)
  10. end
  11. end
  12. end