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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b17101f7d066b8b4a8861de1771d82d1c3fc775
4
- data.tar.gz: a3f4607a4f7a7a50f917410f5bef7da67fc88888
3
+ metadata.gz: 8d621209fc09a0a75fd6c9df0f9d21f55a550da9
4
+ data.tar.gz: 6594f0c3e0c8140e4414df77b9150d2ba03e20ff
5
5
  SHA512:
6
- metadata.gz: 8b88ac7b0baab52c81aeda51d99e4605a181d9d639a044c321f7bc95fb3eb571431ff80b40fea8d51b12d00b5eabf3917502c1d107cca6c84774cf22947f7d80
7
- data.tar.gz: e904de4193ac315572817f0b6b8497e90caab961a98355e4b44c82e1bfe6a125b6a7db12dd50a6d75906b9136f31d186f71c154b5cc193a5c32c6f68f9ef593f
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}, {:token => token()})
15
- true
14
+ @rest_client.post({:plugin => File.new(filename), :multipart => true},:params => {:token => token()})
16
15
  end
17
16
  end
@@ -1,5 +1,5 @@
1
1
 
2
2
 
3
3
  module UPM
4
- VERSION = "0.2"
4
+ VERSION = "0.3"
5
5
  end
@@ -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").to_return(:status => 200)
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
- expect(@client.uploadPlugin("filename")).to eq true
19
- expect(WebMock).to have_requested(:post, "user:password@url").with(:headers => {'token' => 'token123', 'Content-Type'=> /multipart\/form-data\; boundary=[\d]+/})
21
+ @client.uploadPlugin("filename")
22
+ expect(@post_stub).to have_been_requested
20
23
  end
21
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlassian_upm
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - KinWah Lai, Bas Vodde