lita-github 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2def5b26a94d3e8cc55f5c8da28109c7c04283a6
4
- data.tar.gz: 019e7d005d5fa98459bd5fb36fcc24e1b36d34b9
3
+ metadata.gz: dcfb77955c1ab72f3edb5f8ef48168aa385e62dc
4
+ data.tar.gz: 681d91511b1b1c97005cf5ce650ed5994df6c545
5
5
  SHA512:
6
- metadata.gz: 6afe9d22373957f410bb03af8530a367d00f81ebca9ec55d3cb5d698ae50d6cb55b89c05f85076ce21399d45200e5a95045f09e3dfa52c1c2fc610832a2dfa2f
7
- data.tar.gz: bc8bf0a906252b8fc026e10ef798ac65a110c6be0ab99ccfdd664c688a2f43d4f244b106b2e3c66eabd220865a6671ef46f0cc236f2deb39f94c647e009a64a7
6
+ metadata.gz: cd0cc9e6c7d10caf61d4d59216938030b11c58a85bfb3a1e0716f9c316954eaf4b8dc9f30b1b048610ac832d77b1b9901e42fa5b21a9a621a67a1885cd1d8899
7
+ data.tar.gz: e1f6ed1db0558819bd47792756034aa9009d0f9d095e9ec0d1b4a95ad801e1ca517055513604022345b2b267017d91a828f7b6939f9fe2bd2869dcec29098e7d
data/README.md CHANGED
@@ -26,10 +26,10 @@ The configuration options will get their own in-depth doc a little further down
26
26
  * This is an administrative utility, so the token will need pretty wide access to leverage this plugin fully
27
27
  * `config.handlers.github.default_org = ''`
28
28
  * Your company may only have one organization, the handler will allow you to type just the repo name (`lita-github`) instead of `PagerDuty/lita-github`.
29
- * `config.handlers.github.default_team_slugs = ['']`
30
- * if no team is provided when adding a repo, it uses these teams by default -- if unset, only owners can access repo
31
- * the default teams that should be added to a repo based on the slug name:
32
- * When clicking on a team in your org you can use the URL to get the slug: https://github.com/orgs/<ORG>/teams/[slug]
29
+ * `config.handlers.github.default_team_slugs = ['']`
30
+ * if no team is provided when adding a repo, it uses these teams by default -- if unset, only owners can access repo
31
+ * the default teams that should be added to a repo based on the slug name:
32
+ * When clicking on a team in your org you can use the URL to get the slug: https://github.com/orgs/<ORG>/teams/[slug]
33
33
 
34
34
  Commands
35
35
  --------
@@ -21,7 +21,7 @@
21
21
  # @author Tim Heckman <tim@pagerduty.com>
22
22
  module LitaGithub
23
23
  # lita-github version
24
- VERSION = '0.2.0'
24
+ VERSION = '0.2.1'
25
25
 
26
26
  # lita-github version split amongst different revisions
27
27
  MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
@@ -330,8 +330,8 @@ module Lita
330
330
  reply = nil
331
331
  begin
332
332
  octo.create_repository(repo, opts)
333
- opts[:other_teams].each do |team|
334
- add_team_to_repo(full_name, team)
333
+ opts[:other_teams].each do |team_id|
334
+ add_team_to_repo(full_name, gh_team(org, team_id))
335
335
  end if opts.key?(:other_teams)
336
336
  ensure
337
337
  if repo?(full_name)
@@ -336,7 +336,9 @@ describe Lita::Handlers::GithubRepo, lita_handler: true do
336
336
 
337
337
  describe '.create_repo' do
338
338
  before do
339
- allow(github_repo).to receive(:octo).and_return(double('Octokit::Client', create_repository: nil))
339
+ client = double('Octokit::Client', create_repository: nil)
340
+ allow(github_repo).to receive(:octo).and_return(client)
341
+ allow(client).to receive(:team).exactly(2).times.and_return({ id: 42, name: 'heckman' }, { id: 84, name: 'orwell' })
340
342
  end
341
343
 
342
344
  context 'when repo created' do
@@ -352,10 +354,11 @@ describe Lita::Handlers::GithubRepo, lita_handler: true do
352
354
 
353
355
  context 'when other teams are given' do
354
356
  it 'should add teams to the repo after creating it' do
355
- expect(github_repo).to receive(:add_team_to_repo).with('GrapeDuty/lita-test', 42)
356
- expect(github_repo).to receive(:add_team_to_repo).with('GrapeDuty/lita-test', 84)
357
+ expect(github_repo).to receive(:add_team_to_repo).with('GrapeDuty/lita-test', { id: 42, name: 'heckman' })
358
+ expect(github_repo).to receive(:add_team_to_repo).with('GrapeDuty/lita-test', { id: 84, name: 'orwell' })
357
359
  opts = { private: true, team_id: 1, other_teams: [42, 84], organization: github_org }
358
- github_repo.send(:create_repo, github_org, 'lita-test', opts)
360
+ expect(github_repo.send(:create_repo, github_org, 'lita-test', opts))
361
+ .to eql 'Created GrapeDuty/lita-test: https://github.com/GrapeDuty/lita-test'
359
362
  end
360
363
  end
361
364
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Heckman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-16 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler