diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 15:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 15:09:12 +0300 |
commit | 3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad (patch) | |
tree | be5a771e0427ed98cdb58acfd5c631b4b2eb4bf9 /spec/models/service_spec.rb | |
parent | c72e5ebe9938d315ec598197873e71a80168d40a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/service_spec.rb')
-rw-r--r-- | spec/models/service_spec.rb | 7 |
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 |