diff options
author | Robert Speicher <robert@gitlab.com> | 2017-08-28 20:18:30 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-08-28 20:18:30 +0300 |
commit | df677647b80e558aec01ed2ed2130d9bd78930be (patch) | |
tree | 9f8807b14258bbd1056699c66c4e8e81d692ca21 /spec | |
parent | fde6047990d2089686b30a779cded742d2af9d1c (diff) | |
parent | 2ec7cfc91d81c843e82060c7c17da81aac68cb48 (diff) |
Merge branch 'sh-add-spec-to-protected-tags-deletion' into 'master'
Add spec for deleting protected tags
See merge request !13693
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/protected_tags_controller_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/projects/protected_tags_controller_spec.rb b/spec/controllers/projects/protected_tags_controller_spec.rb index 64658988b3f..b6de90039f3 100644 --- a/spec/controllers/projects/protected_tags_controller_spec.rb +++ b/spec/controllers/projects/protected_tags_controller_spec.rb @@ -8,4 +8,21 @@ describe Projects::ProtectedTagsController do get(:index, namespace_id: project.namespace.to_param, project_id: project) end end + + describe "DELETE #destroy" do + let(:project) { create(:project, :repository) } + let(:protected_tag) { create(:protected_tag, :developers_can_create, project: project) } + let(:user) { create(:user) } + + before do + project.add_master(user) + sign_in(user) + end + + it "deletes the protected tag" do + delete(:destroy, namespace_id: project.namespace.to_param, project_id: project, id: protected_tag.id) + + expect { ProtectedTag.find(protected_tag.id) }.to raise_error(ActiveRecord::RecordNotFound) + end + end end |