From 8a3408180ab51effd516de3c8e85d564aa4dfabd Mon Sep 17 00:00:00 2001 From: miks Date: Sat, 8 Sep 2012 17:40:36 +0300 Subject: [PATCH] move "users" test after project tests --- spec/requests/api/projects_spec.rb | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 8c294594..71ed39e7 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -67,33 +67,6 @@ describe Gitlab::API do 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 it "should return a project by id" do get api("/projects/#{project.id}", user) @@ -134,6 +107,33 @@ describe Gitlab::API do 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 it "should return an array of project tags" do get api("/projects/#{project.code}/repository/tags", user)