fix part of the integration specs (basic server): do not memoize the parsed template of a template

did committed Mar 13, 2015
commit 056c6054f23fac65ef1fef3df7b5e3e3d5f43d1b
Showing 3 changed files with 4 additions and 4 deletions
locomotive/steam/models/scope.rb b/lib/locomotive/steam/models/scope.rb +1 -1
@@ @@ -18,7 +18,7 @@ module Locomotive::Steam
end
def to_key
- ['site', @site.try(:_id)].tap do |base|
+ (@site ? ['site', @site._id] : []).tap do |base|
@context.each do |name, object|
base << [name, object.try(:_id)]
end
locomotive/steam/services/liquid_parser_service.rb b/lib/locomotive/steam/services/liquid_parser_service.rb +2 -2
@@ @@ -13,8 +13,8 @@ module Locomotive
end
def _parse(object, options = {})
- # Note: check if the template has already been parsed (caching?)
- object.template ||= ::Liquid::Template.parse(object.liquid_source, options)
+ # Note: the template must not be parsed here
+ ::Liquid::Template.parse(object.liquid_source, options)
end
end
spec/spec_helper.rb +1 -1
@@ @@ -42,5 +42,5 @@ RSpec.configure do |config|
config.before(:all) { remove_logs; setup_common }
config.before { reset! }
config.after { reset! }
- config.order = 'random'
+ config.order = :random
end