atlassian_upm 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atlassian_upm/upm_client.rb +1 -2
- data/lib/atlassian_upm/version.rb +1 -1
- data/spec/upm_spec.rb +8 -5
- 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: 8d621209fc09a0a75fd6c9df0f9d21f55a550da9
|
4
|
+
data.tar.gz: 6594f0c3e0c8140e4414df77b9150d2ba03e20ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45606c6485d20d6b2fe571911fe2701fb8c568c5ddcacb643d8f17554c7a3f63f1d0197ce8619cde07a87de88aaab351bd2a2f2a6f0d1baf060001196ef6c484
|
7
|
+
data.tar.gz: 8baf03c8beb63b998763b27555b7903e615f9086f5b70b975f95df8cee146f31c7be632e178ef7c8eb6b7ca64e76ddb743a55ed1661b65b2d817f1e99e9525cd
|
@@ -11,7 +11,6 @@ class UPMClient
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def uploadPlugin(filename)
|
14
|
-
@rest_client.post({:plugin => File.new(filename), :multipart => true}
|
15
|
-
true
|
14
|
+
@rest_client.post({:plugin => File.new(filename), :multipart => true},:params => {:token => token()})
|
16
15
|
end
|
17
16
|
end
|
data/spec/upm_spec.rb
CHANGED
@@ -5,17 +5,20 @@ describe "Atlassian Universal Plugin Manager" do
|
|
5
5
|
|
6
6
|
before (:each) do
|
7
7
|
@client = UPMClient.new('url','user','password')
|
8
|
-
stub_request(:head, "user:password@url").to_return(:headers => { 'upm_token' => 'token123' })
|
9
|
-
stub_request(:post, "user:password@url")
|
8
|
+
@head_stub = stub_request(:head, "user:password@url").to_return(:headers => { 'upm_token' => 'token123' })
|
9
|
+
@post_stub = stub_request(:post, "user:password@url?token=token123")
|
10
|
+
.with(:headers => {'Content-Type'=> /multipart\/form-data\; boundary=[\d]+/})
|
11
|
+
.to_return(:status => 202)
|
10
12
|
end
|
11
13
|
|
12
14
|
it "should be get the upm_token" do
|
13
15
|
expect(@client.token).to eq 'token123'
|
16
|
+
expect(@head_stub).to have_been_requested
|
14
17
|
end
|
15
18
|
|
16
|
-
it "should be post the plugin to host" do
|
19
|
+
it "should be able to post the plugin to host" do
|
17
20
|
expect(File).to receive(:new).with("filename").and_return(double)
|
18
|
-
|
19
|
-
expect(
|
21
|
+
@client.uploadPlugin("filename")
|
22
|
+
expect(@post_stub).to have_been_requested
|
20
23
|
end
|
21
24
|
end
|