Fix #131 Bug with WpTarget#wordpress?

This commit is contained in:
erwanlr
2013-02-20 15:18:37 +01:00
parent e919474424
commit 12d4e38ab1
2 changed files with 13 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + '/wpscan_helper')
describe WpTarget do
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_TARGET_DIR }
let(:target_url) { 'http://example.localhost/' }
before :each do
Browser.reset
@@ -31,7 +32,7 @@ describe WpTarget do
wp_content_dir: 'wp-content',
wp_plugins_dir: 'wp-content/plugins'
}
@wp_target = WpTarget.new('http://example.localhost/', @options)
@wp_target = WpTarget.new(target_url, @options)
end
it_should_behave_like 'WpReadme'
@@ -108,6 +109,16 @@ describe WpTarget do
it 'should return false if both files are not found (404)' do
@wp_target.should_not be_wordpress
end
context 'when the url contains "wordpress" and is a 404' do
let(:target_url) { 'http://lamp/wordpress-3.5./' }
it 'returns false' do
stub_request(:get, @wp_target.login_url).to_return(status: 404, body: 'The requested URL /wordpress-3.5. was not found on this server.')
@wp_target.should_not be_wordpress
end
end
end
describe '#redirection' do