Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_services/emails_on_push_service_spec.rb')
-rw-r--r--spec/models/project_services/emails_on_push_service_spec.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/models/project_services/emails_on_push_service_spec.rb b/spec/models/project_services/emails_on_push_service_spec.rb
index ce1952b503f..44db95afc57 100644
--- a/spec/models/project_services/emails_on_push_service_spec.rb
+++ b/spec/models/project_services/emails_on_push_service_spec.rb
@@ -21,23 +21,25 @@ describe EmailsOnPushService do
end
end
- context 'when properties is missing branches_to_be_notified' do
- subject { described_class.new(properties: {}) }
+ describe '.new' do
+ context 'when properties is missing branches_to_be_notified' do
+ subject { described_class.new(properties: {}) }
- it 'sets the default value to all' do
- expect(subject.branches_to_be_notified).to eq('all')
+ it 'sets the default value to all' do
+ expect(subject.branches_to_be_notified).to eq('all')
+ end
end
- end
- context 'when branches_to_be_notified is already set' do
- subject { described_class.new(properties: { branches_to_be_notified: 'protected' }) }
+ context 'when branches_to_be_notified is already set' do
+ subject { described_class.new(properties: { branches_to_be_notified: 'protected' }) }
- it 'does not overwrite it with the default value' do
- expect(subject.branches_to_be_notified).to eq('protected')
+ it 'does not overwrite it with the default value' do
+ expect(subject.branches_to_be_notified).to eq('protected')
+ end
end
end
- context 'project emails' do
+ describe '#execute' do
let(:push_data) { { object_kind: 'push' } }
let(:project) { create(:project, :repository) }
let(:service) { create(:emails_on_push_service, project: project) }