Commit 33c69afd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve test merge_request_with_sast_spec.rb

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b04c8ff9
......@@ -2,14 +2,30 @@ require 'spec_helper'
describe 'Merge request with sast', :js do
let(:user) { create(:user) }
let(:project) { create :project, :repository }
let(:project) { create(:project, :public, :repository) }
let(:merge_request) do
create(:merge_request_with_diffs,
source_project: project,
target_project: project,
author: user,
title: 'Bug NS-04')
end
let(:pipeline) do
create(:ci_empty_pipeline, status: :created, project: project)
create(:ci_pipeline,
:success,
project: project,
sha: merge_request.diff_head_sha,
ref: merge_request.source_branch,
head_pipeline_of: merge_request)
end
let(:build) do
let!(:build) do
create(
:ci_build,
:artifacts,
:success,
name: 'sast',
pipeline: pipeline,
options: {
......@@ -19,10 +35,9 @@ describe 'Merge request with sast', :js do
}
)
end
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
before do
allow(merge_request).to receive(:sast_artifact).and_return(build)
stub_licensed_features(sast: true)
project.add_developer(user)
sign_in(user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment