Skip to content

Commit

Permalink
Merge pull request #620 from octokit/org-by-id
Browse files Browse the repository at this point in the history
Allow creating repo under org using organization ID instead of owner/name
  • Loading branch information
pengwynn committed Jun 29, 2015
2 parents 6181e9c + 3dcb918 commit 7a4fbdb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/octokit/client/repositories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def create_repository(name, options = {})
if organization.nil?
post 'user/repos', options
else
post "orgs/#{organization}/repos", options
post "#{Organization.path organization}/repos", options
end
end
alias :create_repo :create_repository
Expand Down
6 changes: 6 additions & 0 deletions spec/octokit/client/repositories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
rescue Octokit::NotFound
end
end

it "creates a repository for an organization by ID" do
request = stub_post(github_url("/organizations/1/repos"))
repository = @client.create_repository("an-org-repo", :organization => 1)
assert_requested request
end
end

describe ".add_deploy_key" do
Expand Down

0 comments on commit 7a4fbdb

Please sign in to comment.