Commit df677647 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-add-spec-to-protected-tags-deletion' into 'master'

Add spec for deleting protected tags

See merge request !13693
parents fde60479 2ec7cfc9
...@@ -8,4 +8,21 @@ describe Projects::ProtectedTagsController do ...@@ -8,4 +8,21 @@ describe Projects::ProtectedTagsController do
get(:index, namespace_id: project.namespace.to_param, project_id: project) get(:index, namespace_id: project.namespace.to_param, project_id: project)
end end
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 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