diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-20 12:11:51 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-28 23:36:40 +0200 |
commit | 3944e16b4bd716fd1f317c89c2c0910de76a2c33 (patch) | |
tree | 5e1db612d3db4fd64bf4efc05dddb0b1e3a12f91 /spec/features/tags/master_deletes_tag_spec.rb | |
parent | 67d3ddfdb681d4e791b3b3b716d2b772f530cc86 (diff) | |
download | gitlab-ce-3944e16b4bd716fd1f317c89c2c0910de76a2c33.tar.gz |
Migrate Git::Repository#rm_tag to Gitaly
Closes gitaly#562
Diffstat (limited to 'spec/features/tags/master_deletes_tag_spec.rb')
-rw-r--r-- | spec/features/tags/master_deletes_tag_spec.rb | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/spec/features/tags/master_deletes_tag_spec.rb b/spec/features/tags/master_deletes_tag_spec.rb index d6a6b8fc7d5..80750c904b5 100644 --- a/spec/features/tags/master_deletes_tag_spec.rb +++ b/spec/features/tags/master_deletes_tag_spec.rb @@ -35,15 +35,30 @@ feature 'Master deletes tag' do end context 'when pre-receive hook fails', js: true do - before do - allow_any_instance_of(Gitlab::Git::HooksService).to receive(:execute) - .and_raise(Gitlab::Git::HooksService::PreReceiveError, 'Do not delete tags') + context 'when Gitaly operation_user_delete_tag feature is enabled' do + before do + allow_any_instance_of(Gitlab::GitalyClient::OperationService).to receive(:rm_tag) + .and_raise(Gitlab::Git::HooksService::PreReceiveError, 'Do not delete tags') + end + + scenario 'shows the error message' do + delete_first_tag + + expect(page).to have_content('Do not delete tags') + end end - scenario 'shows the error message' do - delete_first_tag + context 'when Gitaly operation_user_delete_tag feature is disabled', skip_gitaly_mock: true do + before do + allow_any_instance_of(Gitlab::Git::HooksService).to receive(:execute) + .and_raise(Gitlab::Git::HooksService::PreReceiveError, 'Do not delete tags') + end + + scenario 'shows the error message' do + delete_first_tag - expect(page).to have_content('Do not delete tags') + expect(page).to have_content('Do not delete tags') + end end end |