diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-01 22:34:44 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-02 14:14:09 +0300 |
commit | b24651826f249cd1fcbd87d097c42488d0472611 (patch) | |
tree | ba9ce7b7c945dfe05e129cf635d7f5bf6fe1068f /spec | |
parent | 6c87239653e78ca5aaff9bb19424895c621bf7a1 (diff) |
Add user to BuildDetailsEntity
Also add minor changed needed to pass review
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/jobs_controller_spec.rb | 3 | ||||
-rw-r--r-- | spec/serializers/build_details_entity_spec.rb | 3 | ||||
-rw-r--r-- | spec/serializers/build_entity_spec.rb | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index e3d8b95fe1b..068c4ddf820 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -140,9 +140,10 @@ describe Projects::JobsController do it 'exposes needed information' do expect(response).to have_http_status(:ok) - expect(json_response['new_issue_path']).to end_with('/issues/new') expect(json_response['raw_path']).to match(/builds\/\d+\/raw\z/) expect(json_response.dig('merge_request', 'path')).to match(/merge_requests\/\d+\z/) + expect(json_response['build_failed_options']['new_issue_path']) + .to end_with('/issues/new') end end 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 |