diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-03-25 10:41:38 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-03-26 15:10:31 +0300 |
commit | b27c4420c9e62ffc8cf53a4a854f4907454af400 (patch) | |
tree | 2390248510be0e40eb8cd59b80d27fe973b75f9a /spec/services/tags/destroy_service_spec.rb | |
parent | b4de23a687d16c96f1adaa456e4aeaac64d9cb23 (diff) |
Destroy releases when delete a tag
ok
ok
ok
ok
Diffstat (limited to 'spec/services/tags/destroy_service_spec.rb')
-rw-r--r-- | spec/services/tags/destroy_service_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/tags/destroy_service_spec.rb b/spec/services/tags/destroy_service_spec.rb index 7c8c1dd0d3a..a541d300595 100644 --- a/spec/services/tags/destroy_service_spec.rb +++ b/spec/services/tags/destroy_service_spec.rb @@ -7,11 +7,27 @@ describe Tags::DestroyService do let(:service) { described_class.new(project, user) } describe '#execute' do + subject { service.execute(tag_name) } + it 'removes the tag' do expect(repository).to receive(:before_remove_tag) expect(service).to receive(:success) service.execute('v1.1.0') end + + context 'when there is an associated release on the tag' do + let(:tag) { repository.tags.first } + let(:tag_name) { tag.name } + + before do + project.add_maintainer(user) + create(:release, tag: tag_name, project: project) + end + + it 'destroys the release' do + expect { subject }.to change { project.releases.count }.by(-1) + end + end end end |