Commit 1a18e778 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Remove group api specs

parent c9576926bcab
......@@ -106,6 +106,44 @@
end
end
describe "DELETE /groups/:id" do
context "when authenticated as user" do
it "should remove group" do
delete api("/groups/#{group1.id}", user1)
response.status.should == 200
end
it "should not remove a group if not an owner" do
user3 = create(:user)
group1.add_user(user3, Gitlab::Access::MASTER)
delete api("/groups/#{group1.id}", user3)
response.status.should == 403
end
it "should not remove a non existing group" do
delete api("/groups/1328", user1)
response.status.should == 404
end
it "should not remove a group not attached to user1" do
delete api("/groups/#{group2.id}", user1)
response.status.should == 403
end
end
context "when authenticated as admin" do
it "should remove any existing group" do
delete api("/groups/#{group2.id}", admin)
response.status.should == 200
end
it "should not remove a non existing group" do
delete api("/groups/1328", admin)
response.status.should == 404
end
end
end
describe "POST /groups/:id/projects/:project_id" do
let(:project) { create(:project) }
before(:each) do
......
Supports Markdown
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