summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:37 +0000
commite3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6 (patch)
treee8776263096b027d32d4be5118cccc87b00de2bc /spec/models
parentc1a50b8195f4e36fda9b233acbde57a449bcf6c3 (diff)
downloadgitlab-ce-e3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/service_spec.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index d1a4924c07e..cb8122b6573 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -104,21 +104,29 @@ describe Service do
describe "Test Button" do
describe '#can_test?' do
+ subject { service.can_test? }
+
let(:service) { create(:service, project: project) }
context 'when repository is not empty' do
let(:project) { create(:project, :repository) }
- it 'returns true' do
- expect(service.can_test?).to be true
- end
+ it { is_expected.to be true }
end
context 'when repository is empty' do
let(:project) { create(:project) }
- it 'returns true' do
- expect(service.can_test?).to be true
+ it { is_expected.to be true }
+ end
+
+ context 'when instance-level service' do
+ Service.available_services_types.each do |service_type|
+ let(:service) do
+ service_type.constantize.new(instance: true)
+ end
+
+ it { is_expected.to be_falsey }
end
end
end