disable_spec.rb 472 B

123456789101112131415
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Service::Channel::Admin::Disable, current_user_id: 1 do
  4. subject(:service) { described_class.new(area: channel.area, channel_id: channel.id) }
  5. let!(:channel) { create(:channel, active: true) }
  6. describe '#execute' do
  7. it 'destroys the channel' do
  8. expect { service.execute }.to change { channel.reload.active }.to be(false)
  9. end
  10. end
  11. end