From 71e70980660e7d845ac99dc461c395d5efa56066 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Tue, 11 Apr 2017 17:42:54 +0100 Subject: [PATCH] Add unpublished info pages to the scraper page to have their previews --- app.rb | 2 ++ tests/web/unlinked_pages.rb | 1 + views/scraper_start_page.erb | 3 +++ 3 files changed, 6 insertions(+) diff --git a/app.rb b/app.rb index 570e130d..a444be65 100644 --- a/app.rb +++ b/app.rb @@ -286,5 +286,7 @@ @posts = finder.find_previews finder = Document::Finder.new(pattern: events_pattern, baseurl: '/events/') @events = finder.find_previews + finder = Document::Finder.new(pattern: "#{info_dir}/*.md", baseurl: '/info/') + @infopages = finder.find_previews erb :scraper_start_page, layout: false end diff --git a/tests/web/unlinked_pages.rb b/tests/web/unlinked_pages.rb index b6175c3b..abc46631 100644 --- a/tests/web/unlinked_pages.rb +++ b/tests/web/unlinked_pages.rb @@ -60,6 +60,7 @@ get '/scraper-start-page.html' refute_empty(subject.xpath('//a[contains(@href, "/blog/")]')) refute_empty(subject.xpath('//a[contains(@href, "/events/")]')) + refute_empty(subject.xpath('//a[contains(@href, "/info/") and not(contains(@href, "events"))][1]')) end end end diff --git a/views/scraper_start_page.erb b/views/scraper_start_page.erb index 5171e57a..82b4cb9d 100644 --- a/views/scraper_start_page.erb +++ b/views/scraper_start_page.erb @@ -21,3 +21,6 @@

Unlinked event - <%= event.title %>

<% end %> +<% @infopages.each do |infopage| %> +

Unlinked infopage - <%= infopage.title %>

+<% end %>