debian-mirror-gitlab/spec/services/emails/destroy_service_spec.rb

20 lines
432 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Emails::DestroyService do
2017-09-10 17:25:29 +05:30
let!(:user) { create(:user) }
let!(:email) { create(:email, user: user) }
2018-03-17 18:26:18 +05:30
subject(:service) { described_class.new(user, user: user) }
2017-09-10 17:25:29 +05:30
describe '#execute' do
it 'removes an email' do
2020-04-22 19:07:51 +05:30
response = service.execute(email)
expect(user.emails).not_to include(email)
expect(response).to be true
2017-09-10 17:25:29 +05:30
end
end
end