diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-09-07 16:08:51 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-09-07 16:08:51 +0300 |
commit | 83c1bb688c9fff5c146dcc5fb74fe74c1d948d34 (patch) | |
tree | 352d2754f7dbb9c5ee306eebc4bf1af90f901c41 /spec/models/project_spec.rb | |
parent | d02f36d63c844c2a7ecd825df90745cb7951d982 (diff) |
Add has_auto_devops_implicitly_disabled
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 75c99b62150..48fc77423ff 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2607,6 +2607,50 @@ describe Project do end end + describe '#has_auto_devops_implicitly_disabled?' do + set(:project) { create(:project) } + + context 'when enabled in settings' do + before do + stub_application_setting(auto_devops_enabled: true) + end + + it 'does not have auto devops implicitly disabled' do + expect(project).not_to have_auto_devops_implicitly_disabled + end + end + + context 'when disabled in settings' do + before do + stub_application_setting(auto_devops_enabled: false) + end + + it 'auto devops is implicitly disabled' do + expect(project).to have_auto_devops_implicitly_disabled + end + + context 'when explicitly disabled' do + before do + create(:project_auto_devops, project: project, enabled: false) + end + + it 'does not have auto devops implicitly disabled' do + expect(project).not_to have_auto_devops_implicitly_disabled + end + end + + context 'when explicitly enabled' do + before do + create(:project_auto_devops, project: project) + end + + it 'does not have auto devops implicitly disabled' do + expect(project).not_to have_auto_devops_implicitly_disabled + end + end + end + end + context '#auto_devops_variables' do set(:project) { create(:project) } |