2016-04-21 15:13:14 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe EmailsOnPushService do
|
|
|
|
describe 'Validations' do
|
|
|
|
context 'when service is active' do
|
2017-06-14 18:18:56 +00:00
|
|
|
before do
|
|
|
|
subject.active = true
|
|
|
|
end
|
2016-04-21 15:13:14 +00:00
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:recipients) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when service is inactive' do
|
2017-06-14 18:18:56 +00:00
|
|
|
before do
|
|
|
|
subject.active = false
|
|
|
|
end
|
2016-04-21 15:13:14 +00:00
|
|
|
|
|
|
|
it { is_expected.not_to validate_presence_of(:recipients) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|