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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/magellan/cli/resources/client_version.rb +2 -1
- data/lib/magellan/cli/resources/team.rb +1 -1
- data/lib/magellan/cli/version.rb +1 -1
- data/spec/magellan/cli/resources/client_version_spec.rb +5 -1
- data/spec/magellan/cli/resources/organization_spec.rb +2 -0
- data/spec/magellan/cli/resources/team_spec.rb +8 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a02012f22d7aa0048af7384eeec8052bdf2378e1
|
4
|
+
data.tar.gz: a9fc376533dd36789f0ca03437f56c983ff30c97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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)
|
@@ -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 = {
|
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"
|
data/lib/magellan/cli/version.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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=
|
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=
|
43
|
+
context "role=owners" do
|
40
44
|
let(:role){ "owners" }
|
41
45
|
it do
|
42
46
|
expect{
|