Skip to content

Commit

Permalink
Add unlinked info pages to the scraper page to have their previews
Browse files Browse the repository at this point in the history
  • Loading branch information
octopusinvitro committed Apr 20, 2017
1 parent aa18c63 commit 8c93dc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@
@posts = finder.find_unpublished
finder = Document::Finder.new(pattern: events_pattern, baseurl: '/events/')
@events = finder.find_unpublished
finder = Document::Finder.new(pattern: "#{info_dir}/*.md", baseurl: '/info/')
@infopages = finder.find_all
erb :scraper_start_page, layout: false
end
4 changes: 4 additions & 0 deletions tests/web/unlinked_pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
refute_empty(subject.xpath('//a[contains(text(), "Unlinked event")]'))
end
end

it 'scrapes all info pages, including those unlinked' do
refute_empty(subject.xpath('//a[contains(text(), "Unlinked infopage")]'))
end
end

describe 'The Jinja2 Template' do
Expand Down
3 changes: 3 additions & 0 deletions views/scraper_start_page.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
<p><a href="<%= event.url %>">Unlinked event - <%= event.title %></a></p>
<% end %>
<% @infopages.each do |infopage| %>
<p><a href="<%= infopage.url %>">Unlinked infopage - <%= infopage.title %></a></p>
<% end %>

0 comments on commit 8c93dc2

Please sign in to comment.