summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/data_builder/build_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-15 00:08:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-15 00:08:48 +0000
commitb69f406585ff64b1c5140ebba775cc754fabb358 (patch)
tree9af7dfeb0c3f0f8db189a6e18c6be398a7729e2d /spec/lib/gitlab/data_builder/build_spec.rb
parent866ca4e49ff74ffadf8e6f6ff663a168489c2aba (diff)
downloadgitlab-ce-b69f406585ff64b1c5140ebba775cc754fabb358.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/data_builder/build_spec.rb')
-rw-r--r--spec/lib/gitlab/data_builder/build_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/lib/gitlab/data_builder/build_spec.rb b/spec/lib/gitlab/data_builder/build_spec.rb
index fdb855de786..da27125c9a6 100644
--- a/spec/lib/gitlab/data_builder/build_spec.rb
+++ b/spec/lib/gitlab/data_builder/build_spec.rb
@@ -4,7 +4,8 @@ require 'spec_helper'
describe Gitlab::DataBuilder::Build do
let(:runner) { create(:ci_runner, :instance) }
- let(:build) { create(:ci_build, :running, runner: runner) }
+ let(:user) { create(:user) }
+ let(:build) { create(:ci_build, :running, runner: runner, user: user) }
describe '.build' do
let(:data) do
@@ -22,6 +23,15 @@ describe Gitlab::DataBuilder::Build do
it { expect(data[:project_id]).to eq(build.project.id) }
it { expect(data[:project_name]).to eq(build.project.full_name) }
it { expect(data[:pipeline_id]).to eq(build.pipeline.id) }
+ it {
+ expect(data[:user]).to eq(
+ {
+ name: user.name,
+ username: user.username,
+ avatar_url: user.avatar_url(only_path: false),
+ email: user.email
+ })
+ }
it { expect(data[:commit][:id]).to eq(build.pipeline.id) }
it { expect(data[:runner][:id]).to eq(build.runner.id) }
it { expect(data[:runner][:description]).to eq(build.runner.description) }