From b24651826f249cd1fcbd87d097c42488d0472611 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Thu, 1 Jun 2017 21:34:44 +0200 Subject: Add user to BuildDetailsEntity Also add minor changed needed to pass review --- spec/serializers/build_details_entity_spec.rb | 3 ++- spec/serializers/build_entity_spec.rb | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'spec/serializers') diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 8533cd77d1d..c372df7dd90 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -30,7 +30,8 @@ describe BuildDetailsEntity do it 'contains the needed key value pairs' do expect(subject).to include(:coverage, :erased_at, :duration) expect(subject).to include(:artifacts, :runner, :pipeline) - expect(subject).to include(:raw_path, :merge_request, :new_issue_path) + expect(subject).to include(:raw_path, :merge_request) + expect(subject[:build_failed_options]).to include(:new_issue_path) end it 'exposes details of the merge request' do diff --git a/spec/serializers/build_entity_spec.rb b/spec/serializers/build_entity_spec.rb index 6d5e1046e86..e48d558f33f 100644 --- a/spec/serializers/build_entity_spec.rb +++ b/spec/serializers/build_entity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe BuildEntity do let(:user) { create(:user) } - let(:build) { create(:ci_build) } + let(:build) { create(:ci_build, :failed) } let(:project) { build.project } let(:request) { double('request') } @@ -17,7 +17,8 @@ describe BuildEntity do subject { entity.as_json } it 'contains paths to build page and retry action' do - expect(subject).to include(:build_path, :retry_path) + expect(subject).to include(:build_path, :build_failed_options) + expect(subject.dig(:build_failed_options, :retry_path)).not_to be_nil end it 'does not contain sensitive information' do -- cgit v1.2.1