move "users" test after project tests

This commit is contained in:
miks 2012-09-08 17:40:36 +03:00
parent 2e76342d72
commit 8a3408180a

View file

@ -67,33 +67,6 @@ describe Gitlab::API do
end end
end end
describe "POST /projects/:id/users" do
it "should add users to project" do
expect {
post api("/projects/#{project.code}/users", user),
user_ids: {"0" => user2.id, "1" => user3.id}, project_access: UsersProject::DEVELOPER
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(2)
end
end
describe "PUT /projects/:id/users" do
it "should update users to new access role" do
expect {
put api("/projects/#{project.code}/users", user),
user_ids: {"0" => user}, project_access: UsersProject::DEVELOPER
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(1)
end
end
describe "DELETE /projects/:id/users" do
it "should delete users from project" do
expect {
delete api("/projects/#{project.code}/delete", user),
user_ids: {"0" => users_project.id}
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(-1)
end
end
describe "GET /projects/:id" do describe "GET /projects/:id" do
it "should return a project by id" do it "should return a project by id" do
get api("/projects/#{project.id}", user) get api("/projects/#{project.id}", user)
@ -134,6 +107,33 @@ describe Gitlab::API do
end end
end end
describe "POST /projects/:id/users" do
it "should add users to project" do
expect {
post api("/projects/#{project.code}/users", user),
user_ids: {"0" => user2.id, "1" => user3.id}, project_access: UsersProject::DEVELOPER
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(2)
end
end
describe "PUT /projects/:id/users" do
it "should update users to new access role" do
expect {
put api("/projects/#{project.code}/users", user),
user_ids: {"0" => user}, project_access: UsersProject::DEVELOPER
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(1)
end
end
describe "DELETE /projects/:id/users" do
it "should delete users from project" do
expect {
delete api("/projects/#{project.code}/users", user),
user_ids: {"0" => users_project.id}
}.to change {project.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(-1)
end
end
describe "GET /projects/:id/repository/tags" do describe "GET /projects/:id/repository/tags" do
it "should return an array of project tags" do it "should return an array of project tags" do
get api("/projects/#{project.code}/repository/tags", user) get api("/projects/#{project.code}/repository/tags", user)