Commit 3ba65185 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Prefer using `project.add_developer` in specs

parent 9c37a26c
......@@ -208,7 +208,7 @@ describe Ci::Build, :models do
end
it 'expects to have retried builds instead the original ones' do
project.team << [user, :developer]
project.add_developer(user)
retried_rspec = Ci::Build.retry(rspec_test, user)
......@@ -817,7 +817,7 @@ describe Ci::Build, :models do
subject { build.other_actions }
before do
project.team << [user, :developer]
project.add_developer(user)
end
it 'returns other actions' do
......@@ -865,7 +865,7 @@ describe Ci::Build, :models do
let(:build) { create(:ci_build, :manual, pipeline: pipeline) }
before do
project.team << [user, :developer]
project.add_developer(user)
end
context 'when build is manual' do
......
......@@ -563,7 +563,7 @@ describe Ci::Pipeline, models: true do
context 'on failure and build retry' do
before do
build.drop
project.team << [user, :developer]
project.add_developer(user)
Ci::Build.retry(build, user)
end
......@@ -776,7 +776,7 @@ describe Ci::Pipeline, models: true do
let(:latest_status) { pipeline.statuses.latest.pluck(:status) }
before do
project.team << [user, :developer]
project.add_developer(user)
end
context 'when there is a failed build and failed external status' do
......
......@@ -9,7 +9,7 @@ describe Ci::ProcessPipelineService, :services do
end
before do
project.team << [user, :developer]
project.add_developer(user)
end
describe '#execute' do
......
......@@ -15,7 +15,7 @@ describe Ci::RetryBuildService, :services do
context 'when user has ability to execute build' do
before do
project.team << [user, :developer]
project.add_developer(user)
end
it 'creates a new build that represents the old one' do
......@@ -59,7 +59,7 @@ describe Ci::RetryBuildService, :services do
context 'when user has ability to execute build' do
before do
project.team << [user, :developer]
project.add_developer(user)
end
it 'creates a new build that represents the old one' do
......
......@@ -235,7 +235,7 @@ describe CreateDeploymentService, services: true do
context 'when build is retried' do
it_behaves_like 'does create environment and deployment' do
before do
project.team << [user, :developer]
project.add_developer(user)
end
let(:deployable) { Ci::Build.retry(build, 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