diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
commit | cf1d4237a4f226ba2deed26240544da0675a41e5 (patch) | |
tree | 926a71b9279659bc52db0187b463603934718bf2 /spec/helpers | |
parent | 0ac82f99553ce12009970a14c0afc02d1f6515bb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index d61289dabb6..37bc2b382cb 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -5,6 +5,37 @@ require 'spec_helper' describe ProjectsHelper do include ProjectForksHelper + describe '#project_incident_management_setting' do + let(:project) { create(:project) } + + before do + helper.instance_variable_set(:@project, project) + end + + context 'when incident_management_setting exists' do + let(:project_incident_management_setting) do + create(:project_incident_management_setting, project: project) + end + + it 'return project_incident_management_setting' do + expect(helper.project_incident_management_setting).to( + eq(project_incident_management_setting) + ) + end + end + + context 'when incident_management_setting does not exist' do + it 'builds incident_management_setting' do + setting = helper.project_incident_management_setting + + expect(setting).not_to be_persisted + expect(setting.send_email).to be_falsey + expect(setting.create_issue).to be_truthy + expect(setting.issue_template_key).to be_nil + end + end + end + describe '#error_tracking_setting_project_json' do let(:project) { create(:project) } |