summaryrefslogtreecommitdiff
path: root/spec/models/service_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 12:09:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 12:09:12 +0000
commit3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad (patch)
treebe5a771e0427ed98cdb58acfd5c631b4b2eb4bf9 /spec/models/service_spec.rb
parentc72e5ebe9938d315ec598197873e71a80168d40a (diff)
downloadgitlab-ce-3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/service_spec.rb')
-rw-r--r--spec/models/service_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index f58bcbebd67..eaf19bd4fea 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -10,8 +10,13 @@ describe Service do
it { is_expected.to have_one :issue_tracker_data }
end
- describe 'Validations' do
+ describe 'validations' do
it { is_expected.to validate_presence_of(:type) }
+
+ it 'validates presence of project_id if not template', :aggregate_failures do
+ expect(build(:service, project_id: nil, template: true)).to be_valid
+ expect(build(:service, project_id: nil, template: false)).to be_invalid
+ end
end
describe 'Scopes' do