fix issue #26

did committed Apr 06, 2013
commit b3ffc5cadf6490094f52f3150de304f8e0434289
Showing 4 changed files with 25 additions and 6 deletions
.gitignore +1 -0
@@ @@ -20,6 +20,7 @@ spec/reports
test/tmp
test/version_tmp
tmp
+ spec/fixtures/default/log
/.rbenv-gemsets
/.sass-cache/
locomotive/wagon/liquid/drops/site.rb b/lib/locomotive/wagon/liquid/drops/site.rb +1 -1
@@ @@ -11,7 +11,7 @@ module Locomotive
end
def pages
- @pages ||= liquify(*self._source.pages)
+ @pages ||= liquify(*self.mounting_point.pages.values)
end
end
spec/fixtures/default/app/views/pages/all.liquid.haml +13 -0
@@ @@ -0,0 +1,13 @@
+ ---
+ title: All the pages
+ listed: false
+ published: false
+ ---
+ {% extends parent %}
+ {% block content %}
+ <ul>
+ {% for page in site.pages %}
+ <li>{{ page.title }}</li>
+ {% endfor %}
+ </ul>
+ {% endblock %}
spec/integration/server/basic_spec.rb +10 -5
@@ @@ -9,11 +9,7 @@ describe Locomotive::Wagon::Server do
include Rack::Test::Methods
def app
- path = 'spec/fixtures/default'
- Locomotive::Wagon::Logger.setup(path, false)
- reader = Locomotive::Mounter::Reader::FileSystem.instance
- reader.run!(path: path)
- Locomotive::Wagon::Server.new(reader, disable_listen: true)
+ run_server
end
it 'shows the index page' do
@@ @@ -45,4 +41,13 @@ describe Locomotive::Wagon::Server do
last_response.body.should_not =~ /Powered by/
end
+ it 'returns all the pages' do
+ get '/all'
+ last_response.body.should =~ /Home page/
+ last_response.body.should =~ /<li>Home page<\/li>/
+ last_response.body.should =~ /<li>John-doe<\/li>/
+ last_response.body.should =~ /<li>Songs<\/li>/
+ last_response.body.should =~ /<li>A song template<\/li>/
+ end
+
end
\ No newline at end of file