gitlab-org--gitlab-foss/spec/services/emails/destroy_service_spec.rb

17 lines
382 B
Ruby
Raw Normal View History

2019-03-22 10:56:06 -04:00
# frozen_string_literal: true
2017-06-16 08:07:56 -04:00
require 'spec_helper'
describe Emails::DestroyService do
2017-06-16 08:07:56 -04:00
let!(:user) { create(:user) }
let!(:email) { create(:email, user: user) }
subject(:service) { described_class.new(user, user: user) }
2017-06-16 08:07:56 -04:00
describe '#execute' do
2017-06-16 08:30:29 -04:00
it 'removes an email' do
2017-09-12 11:36:59 -04:00
expect { service.execute(email) }.to change { user.emails.count }.by(-1)
2017-06-16 08:07:56 -04:00
end
end
end