Commit bb8d0e7c authored by Kamil Trzciński's avatar Kamil Trzciński

Simplify test

parent db9ecc76
...@@ -387,27 +387,22 @@ describe Ci::CreatePipelineService do ...@@ -387,27 +387,22 @@ describe Ci::CreatePipelineService do
context 'with environment' do context 'with environment' do
before 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) stub_ci_pipeline_yaml_file(config)
end end
it 'creates the environment' do it 'creates the environment with tags' do
result = execute_service result = execute_service
expect(result).to be_persisted expect(result).to be_persisted
expect(Environment.find_by(name: "review/master")).to be_present expect(Environment.find_by(name: "review/master")).to be_present
end expect(result.builds.first.tag_list).to contain_exactly('hello')
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)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment