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

15 lines
352 B
Ruby
Raw Normal View History

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) }
2017-06-23 13:00:22 -04:00
subject(:service) { described_class.new(user, email: email.email) }
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-06-16 08:07:56 -04:00
expect { service.execute }.to change { user.emails.count }.by(-1)
end
end
end