diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 09:09:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 09:09:25 +0000 |
commit | 6f7881ee9dcec34141a8f34fc814b56b366d2b48 (patch) | |
tree | 25f72a06874b32b1049b79a9d7f4f1b7bca43b9b /spec/models/project_spec.rb | |
parent | 8c8bf44fa64f98114f7439f751c92d59a44b3218 (diff) | |
download | gitlab-ce-6f7881ee9dcec34141a8f34fc814b56b366d2b48.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index ceb6382eb6c..f0423937710 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -5938,6 +5938,24 @@ describe Project do end end + describe '#environments_for_scope' do + let_it_be(:project, reload: true) { create(:project) } + + before do + create_list(:environment, 2, project: project) + end + + it 'retrieves all project environments when using the * wildcard' do + expect(project.environments_for_scope("*")).to eq(project.environments) + end + + it 'retrieves a specific project environment when using the name of that environment' do + environment = project.environments.first + + expect(project.environments_for_scope(environment.name)).to eq([environment]) + end + end + def finish_job(export_job) export_job.start export_job.finish |