Additional specs for #169

This commit is contained in:
erwanlr
2013-04-16 17:33:40 +02:00
parent 788122c5d6
commit eca90894e0
4 changed files with 36 additions and 2 deletions

View File

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

View File

@@ -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) { }

View File

@@ -195,7 +195,6 @@ shared_examples 'WpItems::Detectable' do
@expected = subject.new
end
end
end
context 'when no :only_vulnerable' do