Update upstream source from tag 'upstream/0.8.5'
Update to upstream version '0.8.5'
with Debian dir cf2bbd3994632029bcc22625be0e5e97f45b9496
Sophie Brun
4 years ago
1 | 1 |
|
2 | 2 |
# Version
|
3 | 3 |
module CMSScanner
|
4 | |
VERSION = '0.8.4'
|
|
4 |
VERSION = '0.8.5'
|
5 | 5 |
end
|
56 | 56 |
|
57 | 57 |
# @return [ Typhoeus::Response ]
|
58 | 58 |
def error_404_res
|
59 | |
@error_404_res ||= NS::Browser.get(error_404_url)
|
|
59 |
@error_404_res ||= NS::Browser.get_and_follow_location(error_404_url)
|
60 | 60 |
end
|
61 | 61 |
|
62 | 62 |
# @return [ String ] The URL of an unlikely existant page
|
75 | 75 |
|
76 | 76 |
its(:ip) { should eql '127.0.0.1' }
|
77 | 77 |
end
|
|
78 |
end
|
|
79 |
|
|
80 |
describe '#error_404_res' do
|
|
81 |
before { stub_request(:any, /[a-z\d]{6}\.html/).to_return(stubbed_response) }
|
|
82 |
|
|
83 |
context 'when no redirect' do
|
|
84 |
let(:stubbed_response) { { status: 200, body: 'hello world!' } }
|
|
85 |
|
|
86 |
its('error_404_res.body') { should eql 'hello world!' }
|
|
87 |
end
|
|
88 |
|
|
89 |
# TODO: Uncomment when webmock supports redirects
|
|
90 |
# context 'when redirect' do
|
|
91 |
# let(:redirect) { web_site.url('redirect') }
|
|
92 |
# let(:stubbed_response) { { status: 302, headers: { 'Location' => redirect } } }
|
|
93 |
|
|
94 |
# before { stub_request(:get, redirect).to_return(status: 200, body: 'redirected!') }
|
|
95 |
|
|
96 |
# its('error_404_res.body') { should eql 'redirected!' }
|
|
97 |
# end
|
78 | 98 |
end
|
79 | 99 |
|
80 | 100 |
describe '#error_404_url' do
|