diff options
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 |