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