diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 18:05:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 18:05:58 +0300 |
commit | ad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (patch) | |
tree | 78f95d63d4ea5ed0b1a8b3c83c38d9cbd682f884 /spec/features/merge_request/user_sees_merge_widget_spec.rb | |
parent | 664c4c7b49c6056136299817eb79e9f1de83e567 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/merge_request/user_sees_merge_widget_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_sees_merge_widget_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index 6b6226ad1c5..9fadd46ed44 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -5,6 +5,7 @@ require 'spec_helper' describe 'Merge request > User sees merge widget', :js do include ProjectForksHelper include TestReportsHelper + include ReactiveCachingHelpers let(:project) { create(:project, :repository) } let(:project_only_mwps) { create(:project, :repository, only_allow_merge_if_pipeline_succeeds: true) } @@ -435,6 +436,54 @@ describe 'Merge request > User sees merge widget', :js do end end + context 'exposed artifacts' do + subject { visit project_merge_request_path(project, merge_request) } + + context 'when merge request has exposed artifacts' do + let(:merge_request) { create(:merge_request, :with_exposed_artifacts, source_project: project) } + let(:job) { merge_request.head_pipeline.builds.last } + let!(:artifacts_metadata) { create(:ci_job_artifact, :metadata, job: job) } + + context 'when result has not been parsed yet' do + it 'shows parsing status' do + subject + + expect(page).to have_content('Loading artifacts') + end + end + + context 'when result has been parsed' do + before do + allow_any_instance_of(MergeRequest).to receive(:find_exposed_artifacts).and_return( + status: :parsed, data: [ + { + text: "the artifact", + url: "/namespace1/project1/-/jobs/1/artifacts/file/ci_artifacts.txt", + job_path: "/namespace1/project1/-/jobs/1", + job_name: "test" + } + ]) + end + + it 'shows the parsed results' do + subject + + expect(page).to have_content('View exposed artifact') + end + end + end + + context 'when merge request does not have exposed artifacts' do + let(:merge_request) { create(:merge_request, source_project: project) } + + it 'does not show parsing status' do + subject + + expect(page).not_to have_content('Loading artifacts') + end + end + end + context 'when merge request has test reports' do let!(:head_pipeline) do create(:ci_pipeline, |