Commit f97b636f authored by Sean McGivern's avatar Sean McGivern

Merge branch '31009-disable-test-settings-on-services-when-repository-is-empty' into 'master'

Disables test settings on chat notification services when repository is empty

Closes #31009

See merge request !10759
parents e6d87a97 7696191e
......@@ -22,7 +22,7 @@ class ChatNotificationService < Service
end
def can_test?
valid?
super && valid?
end
def self.supported_events
......
---
title: Disable test settings on chat notification services when repository is empty
merge_request: 10759
author:
require 'spec_helper'
describe ChatNotificationService, models: true do
describe "Associations" do
describe 'Associations' do
before do
allow(subject).to receive(:activated?).and_return(true)
end
it { is_expected.to validate_presence_of :webhook }
end
describe '#can_test?' do
context 'with empty repository' do
it 'returns false' do
subject.project = create(:empty_project, :empty_repo)
expect(subject.can_test?).to be false
end
end
context 'with repository' do
it 'returns true' do
subject.project = create(:project)
expect(subject.can_test?).to be true
end
end
end
end
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