Commit 2ec7cfc9 authored by Stan Hu's avatar Stan Hu

Add spec for deleting protected tags

parent 84336b84
......@@ -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
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