Skip to content

Commit 6fb0285

Browse files
committed
.
Signed-off-by: Gil Desmarais <[email protected]>
1 parent edd5bd0 commit 6fb0285

File tree

4 files changed

+26
-124
lines changed

4 files changed

+26
-124
lines changed

.github/workflows/test_build_push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- uses: ruby/setup-ruby@v1
3030
with:
3131
bundler-cache: true
32+
cache-version: 1
3233

3334
- run: bundle exec rspec
3435

spec/fixtures/vcr_cassettes/auto_source-github-h2r-web.yml

Lines changed: 16 additions & 15 deletions
Large diffs are not rendered by default.

spec/fixtures/vcr_cassettes/auto_source-h2r-web.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

spec/routes/auto_source_spec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def app = described_class
1212
let(:request_headers) do
1313
{ 'HTTP_HOST' => 'localhost' }
1414
end
15+
let(:encoded_url) { Base64.urlsafe_encode64('https://github.com/html2rss/html2rss-web/commits/master') }
1516

1617
let(:username) { 'username' }
1718
let(:password) { 'password' }
@@ -66,8 +67,8 @@ def app = described_class
6667
describe "GET '/auto_source/:encoded_url'" do
6768
context 'with provided basic auth' do
6869
subject(:response) do
69-
VCR.use_cassette 'auto_source-h2r-web' do
70-
get "/auto_source/#{Base64.urlsafe_encode64('https://github.com/html2rss/html2rss-web')}",
70+
VCR.use_cassette('auto_source-github-h2r-web', match_requests_on: [:path]) do
71+
get "/auto_source/#{encoded_url}?strategy",
7172
{},
7273
request_headers.merge('HTTP_AUTHORIZATION' => basic_authorize(username, password))
7374
end
@@ -83,9 +84,11 @@ def app = described_class
8384

8485
context 'when strategy is not registered' do
8586
subject(:response) do
86-
get "/auto_source/#{Base64.urlsafe_encode64('https://github.com/html2rss/html2rss-web')}?strategy=nope",
87-
{},
88-
request_headers.merge('HTTP_AUTHORIZATION' => basic_authorize(username, password))
87+
VCR.use_cassette('auto_source-github-h2r-web', match_requests_on: [:path]) do
88+
get "/auto_source/#{encoded_url}?strategy=nope",
89+
{},
90+
request_headers.merge('HTTP_AUTHORIZATION' => basic_authorize(username, password))
91+
end
8992
end
9093

9194
it 'responds with Error', :aggregate_failures do
@@ -111,7 +114,7 @@ def app = described_class
111114

112115
describe "GET '/auto_source/:encoded_url'" do
113116
it 'responds with 400 Bad Request', :aggregate_failures do
114-
get "/auto_source/#{Base64.urlsafe_encode64('https://github.com/html2rss/html2rss-web')}",
117+
get "/auto_source/#{encoded_url}",
115118
{},
116119
request_headers.merge('HTTP_AUTHORIZATION' => basic_authorize(username, password))
117120

0 commit comments

Comments
 (0)