wetransfer 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +1 -1
- data/lib/we_transfer_client.rb +5 -0
- data/lib/we_transfer_client/version.rb +1 -1
- data/spec/integration_spec.rb +8 -1
- 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: 1b5bfa1c6ff82d87a1f5bd0df47c3af5ceff2163
|
4
|
+
data.tar.gz: 0a285f8cacb13b4ee36c85d1c8dbba71c8b94543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceef985fc774024519eeb25ffd454b879148c58241dcee6e82a2c38dddf767ae2711a8e601e15a902a3636fa160d973eb3cf3bde67e8062d6a99b88c374ee01c
|
7
|
+
data.tar.gz: 62cfcc59be9f9e197b3cdbd9e43759f406f290edff63b65313568cd3c57e0e730f529b4f328620c56578e553189cc856142b14b28e52b26689c24970396ed26b
|
data/bin/console
CHANGED
data/lib/we_transfer_client.rb
CHANGED
@@ -90,6 +90,11 @@ class WeTransferClient
|
|
90
90
|
create_and_upload(future_transfer)
|
91
91
|
end
|
92
92
|
|
93
|
+
def create_empty_transfer(name:, description:)
|
94
|
+
future_transfer = FutureTransfer.new(name: name, description: description, items: [])
|
95
|
+
create_and_upload(future_transfer)
|
96
|
+
end
|
97
|
+
|
93
98
|
def create_and_upload(xfer)
|
94
99
|
authorize_if_no_bearer_token!
|
95
100
|
response = faraday.post(
|
data/spec/integration_spec.rb
CHANGED
@@ -56,7 +56,7 @@ describe WeTransferClient do
|
|
56
56
|
expect(response['location']).to start_with('https://wetransfer')
|
57
57
|
end
|
58
58
|
|
59
|
-
it 'is able to create a transfer with no items' do
|
59
|
+
it 'is able to create a transfer with no items even if passed a block' do
|
60
60
|
client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY'), logger: test_logger)
|
61
61
|
response = client.create_transfer(name: 'My amazing board', description: 'Hi there!') do |builder|
|
62
62
|
end
|
@@ -64,6 +64,13 @@ describe WeTransferClient do
|
|
64
64
|
expect(response[:items]).to eq([])
|
65
65
|
end
|
66
66
|
|
67
|
+
it 'is able to create a transfer with no items without a block' do
|
68
|
+
client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY'), logger: test_logger)
|
69
|
+
response = client.create_empty_transfer(name: 'My amazing board', description: 'Hi there!')
|
70
|
+
expect(response[:size]).to eq(0)
|
71
|
+
expect(response[:items]).to eq([])
|
72
|
+
end
|
73
|
+
|
67
74
|
it 'refuses to create a transfer when reading an IO raises an error' do
|
68
75
|
broken = StringIO.new('hello')
|
69
76
|
def broken.read(*)
|