magellan-cli 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81d4181816437b398636b67acff42a17e42c7612
4
- data.tar.gz: 3cb4698e4a1d55bcdeb0559514e6e26c24b073e3
3
+ metadata.gz: a02012f22d7aa0048af7384eeec8052bdf2378e1
4
+ data.tar.gz: a9fc376533dd36789f0ca03437f56c983ff30c97
5
5
  SHA512:
6
- metadata.gz: 19759caaf922e87d3a05f047c5ab79fa51a007d64091ab499c763f15b10f08f9fa32b9db3e41b684b12579bbaa57a966a18e01c32f5a27cb47155a3e017a93a7
7
- data.tar.gz: 293f9e67ef749634533897c7562aef3a2f3fb3a439ad0627d232ff588256a41ddd8408cc3a1f5f868a3f14d2a5d492a4f7347ecc516e95830baa17450a466d07
6
+ metadata.gz: 3cebafac6b5fc98b854ce60d25d6d195307280b3cf331e2032ed6419b6502a1e87e20095bc2c9d0a317f4f0ab47cbcf210cab590749b04e650269e074002dd78
7
+ data.tar.gz: eb1714d8ed7cb5c37f20bbcc60afbf8e7a2c61887b3f7f79aaecef2442709cec6884b27ec828ca75e2be536554adcbb25c1fcab8a38444abece5922f8da883b2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- magellan-cli (0.2.12)
4
+ magellan-cli (0.2.13)
5
5
  activesupport (~> 4.1.4)
6
6
  httpclient
7
7
  nokogiri
@@ -20,7 +20,7 @@ GEM
20
20
  coderay (1.1.0)
21
21
  diff-lcs (1.2.5)
22
22
  httpclient (2.5.3.3)
23
- i18n (0.6.11)
23
+ i18n (0.7.0)
24
24
  json (1.8.1)
25
25
  method_source (0.8.2)
26
26
  mini_portile (0.6.1)
@@ -24,7 +24,8 @@ module Magellan
24
24
  }
25
25
  }
26
26
  post_json("/admin/#{resource_name}/new.json", params)
27
- select(version)
27
+ # TODO implement select method
28
+ # select(version)
28
29
  end
29
30
  end
30
31
 
@@ -7,7 +7,7 @@ module Magellan
7
7
 
8
8
  class Team < Base
9
9
  self.resource_name = "magellan~auth~team"
10
- self.resource_dependency = { "organization" => Organization.parameter_name }
10
+ self.resource_dependency = { Organization.parameter_name => Organization.parameter_name }
11
11
  self.field_associations = {"organization_id" => {name: "organization", class: "Organization"} }
12
12
 
13
13
  desc "create NAME ROLE", "create Team with NAME ROLE"
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  module Cli
3
- VERSION = "0.2.12"
3
+ VERSION = "0.2.13"
4
4
  end
5
5
  end
@@ -18,9 +18,13 @@ describe Magellan::Cli::Resources::ClientVersion do
18
18
 
19
19
  describe :create do
20
20
  describe :success do
21
+ let(:client_version_list_response) { [ { "id" => 1, "version" => "1.1.0" } ] }
21
22
  before do
22
- expect(cmd).to receive(:load_selections).and_return({"project" => {"id" => 1, "name" => "ProjectA"}, "stage" => {"id" => 1, "name" => "StageA"} })
23
+ allow(cmd).to receive(:load_selections).and_return({"project" => {"id" => 1, "name" => "ProjectA"}, "stage" => {"id" => 1, "name" => "StageA"} })
23
24
  expect(cmd).to receive(:post_json).with("/admin/client_version/new.json", { "client_version" => { "stage_title_id" => 1, "version" => "1.1.0" } })
25
+ # TODO: stub in details
26
+ # expect(cmd).to receive(:get_json).with(any_args).and_return(client_version_list_response)
27
+ # expect(cmd).to receive(:update_selections).with("client_version" => { "id" => 1, "version" => "1.0.0" })
24
28
  end
25
29
  it do
26
30
  cmd.create("1.1.0")
@@ -16,8 +16,10 @@ describe Magellan::Cli::Resources::Organization do
16
16
  end
17
17
 
18
18
  describe :create do
19
+ let(:organization_list_response) { [ { "id" => 1, "name" => "new1" } ] }
19
20
  before do
20
21
  expect(cmd).to receive(:post_json).with("/admin/magellan~auth~organization/new.json", {"magellan_auth_organization" => { "name" => "new1" }})
22
+ allow(cmd).to receive(:get_json).with(any_args).and_return(organization_list_response)
21
23
  end
22
24
  it do
23
25
  cmd.create("new1")
@@ -7,7 +7,7 @@ describe Magellan::Cli::Resources::Team do
7
7
 
8
8
  describe :list do
9
9
  before do
10
- expect(cmd).to receive(:load_selections).and_return({"magellan_auth_organization" => {"id" => "1", "name" => "testorg1"} })
10
+ expect(cmd).to receive(:load_selections).and_return({"magellan_auth_organization" => {"id" => "1", "name" => "testorg1"}})
11
11
  expect(cmd).to receive(:get_json).and_return([{id: 1, organization_id: 1, name: "team1" }])
12
12
  expect($stdout).to receive(:puts)
13
13
  end
@@ -18,9 +18,13 @@ describe Magellan::Cli::Resources::Team do
18
18
 
19
19
  describe :create do
20
20
  describe :success do
21
+ let(:team_list_response) { [{"id" => 1, "name" => "team1"}] }
21
22
  before do
22
- expect(cmd).to receive(:load_selection).with("magellan_auth_organization").and_return({"id" => 1, "name" => "org1"})
23
+ allow(cmd).to receive(:load_selections).and_return({"magellan_auth_organization" => {"id" => 1, "name" => "org1"}})
23
24
  expect(cmd).to receive(:post_json).with("/admin/magellan~auth~team/new.json", { "magellan_auth_team" => { "organization_id" => 1, "name" => "team1", "role" => role } })
25
+ # TODO: stub in details...
26
+ allow(cmd).to receive(:get_json).with(any_args).and_return(team_list_response)
27
+ allow(cmd).to receive(:get_json).with(any_args).and_return(team_list_response)
24
28
  end
25
29
  context "role=readers" do
26
30
  let(:role){ "readers" }
@@ -28,7 +32,7 @@ describe Magellan::Cli::Resources::Team do
28
32
  cmd.create("team1", role)
29
33
  end
30
34
  end
31
- context "role=readers" do
35
+ context "role=admin" do
32
36
  let(:role){ "admin" }
33
37
  it do
34
38
  cmd.create("team1", role)
@@ -36,7 +40,7 @@ describe Magellan::Cli::Resources::Team do
36
40
  end
37
41
  end
38
42
  describe :error do
39
- context "role=readers" do
43
+ context "role=owners" do
40
44
  let(:role){ "owners" }
41
45
  it do
42
46
  expect{
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magellan-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm2000