2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Emails::DestroyService do
|
|
|
|
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
|