Commit 8a340818 authored by miks's avatar miks

move "users" test after project tests

parent 2e76342d
...@@ -67,33 +67,6 @@ describe Gitlab::API do ...@@ -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 ...@@ -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)
......
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