get the expanded path of a site (when run from the Steam binary) + use the default page order if looking for a templatized page

did committed Mar 14, 2015
commit 72d84a0b775004bd3b8502af2f78d57f32d9c776
Showing 5 changed files with 13 additions and 6 deletions
Rakefile +3 -3
@@ @@ -26,12 +26,12 @@ end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec') do |spec|
- spec.exclude_pattern = 'spec/unit/liquid/**/*_spec.rb,spec/integration/server/**/*_spec.rb'
+ spec.exclude_pattern = 'spec/integration/server/contact_form_spec.rb'
end
RSpec::Core::RakeTask.new('spec:integration') do |spec|
- # spec.pattern = 'spec/integration/**/*_spec.rb'
- spec.pattern = 'spec/integration/{mongodb,repositories}/**/*_spec.rb'
+ spec.pattern = 'spec/integration/**/*_spec.rb'
+ # spec.pattern = 'spec/integration/{mongodb,repositories}/**/*_spec.rb'
end
RSpec::Core::RakeTask.new('spec:unit') do |spec|
bin/steam.rb +1 -1
@@ @@ -10,7 +10,7 @@ require 'thin'
require_relative '../lib/locomotive/steam'
require_relative '../lib/locomotive/steam/server'
- path = ARGV[0] || ENV['SITE_PATH'] || File.join(File.expand_path(File.dirname(__FILE__)), '../spec/fixtures/default')
+ path = File.expand_path(ARGV[0] || ENV['SITE_PATH'] || File.join(File.dirname(__FILE__), '../spec/fixtures/default'))
Locomotive::Steam.configure do |config|
config.mode = :test
locomotive/steam/entities/editable_element.rb b/lib/locomotive/steam/entities/editable_element.rb +3 -1
@@ @@ -6,7 +6,9 @@ module Locomotive::Steam
attr_accessor :page
- # TODO
+ def default_content?
+ !!self[:default_content]
+ end
end
locomotive/steam/repositories/page_repository.rb b/lib/locomotive/steam/repositories/page_repository.rb +1 -1
@@ @@ -36,7 +36,7 @@ module Locomotive
conditions[:handle] = handle if handle
- query { where(conditions) }.first.tap do |page|
+ all(conditions).first.tap do |page|
page.content_entry = entry if page
end
end
spec/integration/server/basic_spec.rb +5 -0
@@ @@ -14,6 +14,11 @@ describe Locomotive::Steam::Server do
expect(last_response.body).to match(/Upcoming events/)
end
+ it 'shows the about us page' do
+ get '/about-us'
+ expect(last_response.status).to eq(200)
+ end
+
it 'shows an inner page' do
get '/about-us/jane-doe'
expect(last_response.body).to include '<link href="/stylesheets/application.css"'