Skip to content

Commit

Permalink
Fixed an issue with access level var in add team project
Browse files Browse the repository at this point in the history
GITLAB-698 (GITLAB-116)
  • Loading branch information
Izaak Alpert committed Jun 14, 2013
1 parent 8a5d679 commit d1f581f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
6 changes: 3 additions & 3 deletions lib/gitlab/client/user_teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def user_team(team_id)
# @param [String] (required) - new user team internal name
# @return [Gitlab::ObjectifiedHash] Information about created user.
def create_user_team(name, path)
post("/user_teams", :body => {:name => name, :path=> path})
post("/user_teams", :body => {:name => name, :path => path})
end

# Get a list of project team members. If user id is specified get a specific user
Expand Down Expand Up @@ -91,10 +91,10 @@ def user_teams_projects(team_id, project_id = nil)
#
# @param [Integer] (required) The ID of a user team
# @param [Integer] (required) The ID of a project to add
# @param [Integer] (required) greatest_access_level (required) - Maximum project access level
# @param [Integer] (required) - Maximum project access level
# @return [Array<Gitlab::ObjectifiedHash>] Information about added team project.
def add_team_project(team_id, project_id, access_level)
post("/user_teams/#{team_id}/projects", :body => {:project_id => project_id, :access_level => access_level})
post("/user_teams/#{team_id}/projects", :body => {:project_id => project_id, :greatest_access_level => access_level})
end

# Remove user team project
Expand Down
47 changes: 24 additions & 23 deletions spec/gitlab/client/user_teams_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,35 @@
end


describe ".team_members" do
before do
stub_get("/user_teams/3/members", "user_team_members")
@team_members = Gitlab.user_team_members(3)
end

it "should get the correct resource" do
a_get("/user_teams/3/members").should have_been_made
end
describe ".user_team_members" do
context "when with no specific member" do
before do
stub_get("/user_teams/3/members", "user_team_members")
@team_members = Gitlab.user_team_members(3)
end

it "should return an array of team members" do
@team_members.should be_an Array
@team_members.first.name.should == "John Smith"
end
end
it "should get the correct resource" do
a_get("/user_teams/3/members").should have_been_made
end

describe ".user_team_members" do
before do
stub_get("/user_teams/3/members/1", "user_team_member")
@team_members = Gitlab.user_team_members(3, 1)
it "should return an array of team members" do
@team_members.should be_an Array
@team_members.first.name.should == "John Smith"
end
end
context "when passed a particular member" do
before do
stub_get("/user_teams/3/members/1", "user_team_member")
@team_members = Gitlab.user_team_members(3, 1)
end

it "should get the correct resource" do
a_get("/user_teams/3/members/1").should have_been_made
end
it "should get the correct resource" do
a_get("/user_teams/3/members/1").should have_been_made
end

it "should return information about a team member" do
@team_members.name.should == "John Smith"
it "should return information about a team member" do
@team_members.name.should == "John Smith"
end
end
end

Expand Down

0 comments on commit d1f581f

Please sign in to comment.