diff --git a/app.rb b/app.rb index 7b89c835..daf88442 100644 --- a/app.rb +++ b/app.rb @@ -284,5 +284,7 @@ @places = mapit.places_of_type('FED') + mapit.places_of_type('SEN') + mapit.places_of_type('STA') finder = Document::Finder.new(pattern: posts_pattern, baseurl: '/blog/') @posts = finder.find_unpublished + finder = Document::Finder.new(pattern: events_pattern, baseurl: '/events/') + @events = finder.find_unpublished erb :scraper_start_page, layout: false end diff --git a/tests/web/unlinked_pages.rb b/tests/web/unlinked_pages.rb index f11a34cd..221abd30 100644 --- a/tests/web/unlinked_pages.rb +++ b/tests/web/unlinked_pages.rb @@ -52,13 +52,14 @@ subject.xpath('//a[contains(@href, "/places/")]').count.must_equal(fed + sen + sta) end - it 'scrapes unlinked post pages' do + it 'scrapes unlinked documents (post events and info pages)' do unpublished = '--- published: false ---' Dir.stub :glob, [new_tempfile(unpublished)] do get '/scraper-start-page.html' refute_empty(subject.xpath('//a[contains(text(), "Unlinked post")]')) + refute_empty(subject.xpath('//a[contains(text(), "Unlinked event")]')) end end end diff --git a/views/scraper_start_page.erb b/views/scraper_start_page.erb index 4b9df416..5171e57a 100644 --- a/views/scraper_start_page.erb +++ b/views/scraper_start_page.erb @@ -16,3 +16,8 @@ <% @posts.each do |post| %>

Unlinked post - <%= post.title %>

<% end %> + +<% @events.each do |event| %> +

Unlinked event - <%= event.title %>

+<% end %> +