Skip to content

Commit 29de671

Browse files
committed
Fix bug caused by API redirect
Using the URL suggested by the BitBucket docs causes a redirect and returns nil, using the address it redirects to.
1 parent f13e56f commit 29de671

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/bitbucket_rest_api/teams.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def following(team_name)
3737
end
3838

3939
def repos(team_name)
40-
response = get_request("/2.0/teams/#{team_name.to_s}/repositories")
40+
response = get_request("/2.0/repositories/#{team_name.to_s}")
4141
return response unless block_given?
4242
response["values"].each { |el| yield el }
4343
end

spec/bitbucket_rest_api/teams_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
before do
115115
expect(team).to receive(:request).with(
116116
:get,
117-
'/2.0/teams/team_name/repositories',
117+
'/2.0/repositories/team_name',
118118
{},
119119
{}
120120
).and_return({"values" => ['repo1', 'repo2', 'repo3']})

0 commit comments

Comments
 (0)