Commit 8029c92e authored by Shinya Maeda's avatar Shinya Maeda

Reduce changes

parent d8fb903e
......@@ -371,6 +371,8 @@ describe Projects::JobsController do
end
describe 'POST erase' do
let(:role) { :master }
before do
project.team << [user, role]
sign_in(user)
......@@ -378,8 +380,6 @@ describe Projects::JobsController do
post_erase
end
let(:role) { :master }
context 'when job is erasable' do
let(:job) { create(:ci_build, :erasable, :trace, pipeline: pipeline) }
......
......@@ -500,9 +500,10 @@ describe API::Jobs do
end
describe 'POST /projects/:id/jobs/:job_id/erase' do
context 'when a master erases a build' do
let(:role) { :master }
before do
project.add_master(user)
project.team << [user, role]
post api("/projects/#{project.id}/jobs/#{job.id}/erase", user)
end
......@@ -532,15 +533,9 @@ describe API::Jobs do
expect(response).to have_gitlab_http_status(403)
end
end
end
context 'when a developer erases a build' do
before do
project.add_developer(user)
post api("/projects/#{project.id}/jobs/#{job.id}/erase", user)
end
let(:role) { :developer }
let(:job) { create(:ci_build, :trace, :artifacts, :success, project: project, pipeline: pipeline, user: owner) }
context 'when the build was created by the developer' do
......
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