@@ -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