Commit b84f494e authored by Stan Hu's avatar Stan Hu

Merge branch 'order_emails_on_push_service_spec_in_describe_blocks' into 'master'

Add describe blocks to emails_on_push_service_spec

See merge request gitlab-org/gitlab!32439
parents 06da9c5b 4f548a65
...@@ -21,23 +21,25 @@ describe EmailsOnPushService do ...@@ -21,23 +21,25 @@ describe EmailsOnPushService do
end end
end end
context 'when properties is missing branches_to_be_notified' do describe '.new' do
subject { described_class.new(properties: {}) } context 'when properties is missing branches_to_be_notified' do
subject { described_class.new(properties: {}) }
it 'sets the default value to all' do it 'sets the default value to all' do
expect(subject.branches_to_be_notified).to eq('all') expect(subject.branches_to_be_notified).to eq('all')
end
end end
end
context 'when branches_to_be_notified is already set' do context 'when branches_to_be_notified is already set' do
subject { described_class.new(properties: { branches_to_be_notified: 'protected' }) } subject { described_class.new(properties: { branches_to_be_notified: 'protected' }) }
it 'does not overwrite it with the default value' do it 'does not overwrite it with the default value' do
expect(subject.branches_to_be_notified).to eq('protected') expect(subject.branches_to_be_notified).to eq('protected')
end
end end
end end
context 'project emails' do describe '#execute' do
let(:push_data) { { object_kind: 'push' } } let(:push_data) { { object_kind: 'push' } }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:service) { create(:emails_on_push_service, project: project) } let(:service) { create(:emails_on_push_service, project: project) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment