diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-12 21:49:12 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-12 21:49:12 +0300 |
commit | bb8d0e7c59f53e9a4659412e960accc2d80a9406 (patch) | |
tree | 594761353d3f437c039427c680db6911ba00c859 /spec/services/ci/create_pipeline_service_spec.rb | |
parent | db9ecc76178e0a4e800e885bf04624dd79168b78 (diff) |
Simplify test
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 5f67d732cc6..d2322fa4cab 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -387,27 +387,22 @@ describe Ci::CreatePipelineService do context 'with environment' do before do - config = YAML.dump(deploy: { environment: { name: "review/$CI_COMMIT_REF_NAME" }, script: 'ls'}) + config = YAML.dump( + deploy: { + environment: { name: "review/$CI_COMMIT_REF_NAME" }, + script: 'ls', + tags: ['hello'] + }) + stub_ci_pipeline_yaml_file(config) end - it 'creates the environment' do + it 'creates the environment with tags' do result = execute_service expect(result).to be_persisted expect(Environment.find_by(name: "review/master")).to be_present - end - - it 'also has tags' do - config = YAML.dump(deploy: { environment: { name: "review/$CI_COMMIT_REF_NAME" }, script: 'ls', tags: ['hello'] }) - stub_ci_pipeline_yaml_file(config) - result = execute_service - - config = YAML.dump(deploy: { tags: ['hello'], script: ['ls'] }) - stub_ci_pipeline_yaml_file(config) - result = execute_service - - expect(Ci::Build.with_any_tags.count).to eq(2) + expect(result.builds.first.tag_list).to contain_exactly('hello') end end |