summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/data_builder/pipeline_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/data_builder/pipeline_spec.rb')
-rw-r--r--spec/lib/gitlab/data_builder/pipeline_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb
index fd7cadeb89e..cf04f560ceb 100644
--- a/spec/lib/gitlab/data_builder/pipeline_spec.rb
+++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb
@@ -37,6 +37,7 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
expect(build_data[:id]).to eq(build.id)
expect(build_data[:status]).to eq(build.status)
expect(build_data[:allow_failure]).to eq(build.allow_failure)
+ expect(build_data[:environment]).to be_nil
expect(runner_data).to eq(nil)
expect(project_data).to eq(project.hook_attrs(backward: false))
expect(data[:merge_request]).to be_nil
@@ -115,5 +116,12 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
expect(build_data[:id]).to eq(build.id)
end
end
+
+ context 'build with environment' do
+ let!(:build) { create(:ci_build, :teardown_environment, pipeline: pipeline) }
+
+ it { expect(build_data[:environment][:name]).to eq(build.expanded_environment_name) }
+ it { expect(build_data[:environment][:action]).to eq(build.environment_action) }
+ end
end
end