Commit d04122e3 authored by Shinya Maeda's avatar Shinya Maeda

Fix flaky spec stop_environments_service_spec

This commit fixes the flaky spec failure
parent 90fd52b0
...@@ -217,18 +217,20 @@ describe Ci::StopEnvironmentsService do ...@@ -217,18 +217,20 @@ describe Ci::StopEnvironmentsService do
context 'when user does not have a permission to play the stop action' do context 'when user does not have a permission to play the stop action' do
before do before do
Ci::Build.find_by_ref('review/feature-2').update_column(:user_id, nil) project.team.truncate
end end
it 'tracks the exception' do it 'tracks the exception' do
deployable = Ci::Build.find_by_ref('review/feature-2')
expect(Gitlab::ErrorTracking) expect(Gitlab::ErrorTracking)
.to receive(:track_error) .to receive(:track_error)
.with(Gitlab::Access::AccessDeniedError, deployable_id: deployable.id).once .with(Gitlab::Access::AccessDeniedError, anything).twice
subject subject
end end
after do
project.add_developer(user)
end
end end
end end
......
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