HELLO v3!!!

This commit is contained in:
Ryan Dewhurst
2018-09-26 21:12:01 +02:00
parent 28b9c15256
commit d268a86795
1871 changed files with 988118 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
shared_examples 'App::Finders::WpItems::URLsInHomepage' do
before do
stub_request(:get, finder.target.url).to_return(body: File.read(File.join(fixtures, file)))
end
describe '#items_from_links' do
context 'when none found' do
let(:file) { 'none.html' }
it 'returns an empty array' do
expect(finder.items_from_links(type)).to eql([])
end
end
context 'when found' do
let(:file) { 'found.html' }
it 'returns the expected array' do
expect(finder.target).to receive(:content_dir).at_least(1).and_return('wp-content')
expect(finder.items_from_links(type, uniq_links)).to eql expected_from_links
end
end
end
describe '#items_from_codes' do
before { expect(finder.target).to receive(:content_dir).at_least(1).and_return('wp-content') }
context 'when none found' do
let(:file) { 'none.html' }
it 'returns an empty array' do
expect(finder.items_from_codes(type)).to eql([])
end
end
context 'when found' do
let(:file) { 'found.html' }
it 'returns the expected array' do
expect(finder.items_from_codes(type, uniq_codes)).to eql expected_from_codes
end
end
end
end