Additional specs for #169
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
shared_examples 'WpItem::Existable' do
|
||||
let(:fixtures_dir) { MODELS_FIXTURES + '/wp_item/existable' }
|
||||
|
||||
describe '#exists?' do
|
||||
context 'when the response is supplied' do
|
||||
@@ -75,6 +76,19 @@ shared_examples 'WpItem::Existable' do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when it\'s a redirect to the homepage' do
|
||||
context 'and the cache generation time is in comment tag' do
|
||||
let(:body) { File.new(fixtures_dir + '/cache_generation.html').read }
|
||||
let(:uncommented_body) { body.gsub(/<!--.*?-->/m, '') }
|
||||
let(:exists_options) { { homepage_hash: Digest::MD5.hexdigest(uncommented_body) } }
|
||||
|
||||
it 'returns false' do
|
||||
@resp_opt = { code: 200, body: body }
|
||||
@expected = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
shared_examples 'WpItem::Infos' do
|
||||
|
||||
# 3 expected urls have to be set in the described class (or subject)
|
||||
# 2 expected urls have to be set in the described class (or subject)
|
||||
# e.g :
|
||||
# let(:changelog_url) { }
|
||||
# let(:error_log_url) { }
|
||||
|
||||
@@ -195,7 +195,6 @@ shared_examples 'WpItems::Detectable' do
|
||||
@expected = subject.new
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'when no :only_vulnerable' do
|
||||
|
||||
Reference in New Issue
Block a user