diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-13 18:12:32 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-13 18:12:32 +0100 |
commit | 34bf5d863ec1655e3681997c549d159fea6983a9 (patch) | |
tree | e751c69843b79acc74522d07cd2aac440c252d45 /spec/features/tags/master_deletes_tag_spec.rb | |
parent | 32da7602686f2b8161175d82b121deb9e01b2db5 (diff) | |
download | gitlab-ce-handle-failure-when-deleting-tags.tar.gz |
Display error message when deleting tag in web UI failshandle-failure-when-deleting-tags
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 0f30f562539..ccfafe6db7d 100644 --- a/spec/features/tags/master_deletes_tag_spec.rb +++ b/spec/features/tags/master_deletes_tag_spec.rb @@ -10,16 +10,12 @@ feature 'Master deletes tag', feature: true do visit namespace_project_tags_path(project.namespace, project) end - context 'from the tags list page' do + context 'from the tags list page', js: true do scenario 'deletes the tag' do expect(page).to have_content 'v1.1.0' - page.within('.content') do - first('.btn-remove').click - end + delete_first_tag - expect(current_path).to eq( - namespace_project_tags_path(project.namespace, project)) expect(page).not_to have_content 'v1.1.0' end end @@ -37,4 +33,23 @@ feature 'Master deletes tag', feature: true do expect(page).not_to have_content 'v1.0.0' end end + + context 'when pre-receive hook fails', js: true do + before do + allow_any_instance_of(GitHooksService).to receive(:execute) + .and_raise(GitHooksService::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 + + def delete_first_tag + page.within('.content') do + first('.btn-remove').click + end + end end |