Skip to content

Commit 6af07d8

Browse files
committed
Move GlotpressDownloader tests in dedicated file
1 parent c63fb04 commit 6af07d8

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
module Fastlane
55
module Helper
6-
class GlotPressDownloader
6+
class GlotpressDownloader
77
AUTO_RETRY_SLEEP_TIME = 20
88
MAX_AUTO_RETRY_ATTEMPTS = 30
99

spec/metadata_download_helper_spec.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
require 'spec_helper'
22

3-
describe Fastlane::Helper::GlotPressDownloader do
4-
describe 'downloading' do
5-
context 'when GlotPress returs a 429 code' do
6-
it 'automatically retries' do
7-
downloader = described_class.new(true)
8-
fake_url = 'https://test.com'
9-
10-
count = 0
11-
stub_request(:get, fake_url).to_return do
12-
count += 1
13-
if count == 1
14-
{ status: 429, body: 'Too Many Requests' }
15-
else
16-
{ status: 200, body: 'OK' }
17-
end
18-
end
19-
20-
expect(Fastlane::UI).to receive(:message)
21-
.with(/Received 429 for `#{fake_url}`. Auto retrying in 20 seconds.../)
22-
23-
response = downloader.download(fake_url)
24-
25-
expect(count).to eq(2)
26-
expect(response.code).to eq('200')
27-
end
28-
end
29-
end
30-
end
31-
323
describe Fastlane::Helper::MetadataDownloader do
334
describe 'downloading from GlotPress' do
345
context 'when GlotPress returs a 429 code' do

0 commit comments

Comments
 (0)