Codebase list ruby-cms-scanner / 30ad9bb
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
3 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
11
22 # Version
33 module CMSScanner
4 VERSION = '0.8.4'
4 VERSION = '0.8.5'
55 end
5656
5757 # @return [ Typhoeus::Response ]
5858 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)
6060 end
6161
6262 # @return [ String ] The URL of an unlikely existant page
7575
7676 its(:ip) { should eql '127.0.0.1' }
7777 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
7898 end
7999
80100 describe '#error_404_url' do